@thatopen/components 2.0.0-alpha.2 → 2.0.0-alpha.4
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 +1 -1
- package/dist/core/Types/src/interfaces.d.ts +3 -14
- package/dist/fragments/FragmentHider/index.d.ts +10 -0
- package/dist/fragments/index.d.ts +2 -0
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +65 -19
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +2906 -2319
- package/dist/measurement/Utils/index.d.ts +20 -0
- package/dist/measurement/index.d.ts +1 -0
- package/dist/namespace.d.ts +1150 -840
- package/dist/navigation/MiniMap/index.d.ts +15 -0
- package/dist/navigation/MiniMap/src/index.d.ts +34 -0
- package/dist/navigation/OrthoPerspectiveCamera/index.d.ts +50 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/first-person-mode.d.ts +16 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/index.d.ts +5 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/orbit-mode.d.ts +16 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/plan-mode.d.ts +20 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/projections.d.ts +37 -0
- package/dist/navigation/OrthoPerspectiveCamera/src/types.d.ts +27 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/vertex-picker.d.ts +31 -0
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
3
|
+
import { SimpleRaycaster } from "./src";
|
|
4
|
+
import { Components } from "../Components";
|
|
5
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
6
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
list: Map<string, SimpleRaycaster>;
|
|
9
|
+
onDisposed: Event<unknown>;
|
|
10
|
+
constructor(components: Components);
|
|
11
|
+
get(world: World): SimpleRaycaster;
|
|
12
|
+
delete(world: World): void;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
2
15
|
import { Component, Disposable, Event } from "../Types";
|
|
3
16
|
/**
|
|
4
17
|
* The entry point of the Components library.
|
|
@@ -94,19 +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
110
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
111
111
|
import { Components } from "../Components";
|
|
112
112
|
import { SimpleWorld } from "./src";
|
|
@@ -177,7 +177,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
177
177
|
* has to be 'true' for this to apply.
|
|
178
178
|
*/
|
|
179
179
|
toleranceOrthogonalY: number;
|
|
180
|
-
|
|
180
|
+
list: T[];
|
|
181
181
|
protected PlaneType: new (...args: any) => SimplePlane | T;
|
|
182
182
|
/** The material used in all the clipping planes. */
|
|
183
183
|
protected _material: THREE.Material;
|
|
@@ -322,90 +322,6 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
322
322
|
/** {@link Disposable.dispose} */
|
|
323
323
|
dispose(): void;
|
|
324
324
|
}
|
|
325
|
-
import * as WEBIFC from "web-ifc";
|
|
326
|
-
import * as FRAG from "bim-fragment";
|
|
327
|
-
/**
|
|
328
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
329
|
-
*/
|
|
330
|
-
export declare class IfcJsonExporter {
|
|
331
|
-
/**
|
|
332
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
333
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
334
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
335
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
336
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
337
|
-
* to make the location data available (e.g. absolute position of building).
|
|
338
|
-
*/
|
|
339
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
340
|
-
}
|
|
341
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
342
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
343
|
-
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
344
|
-
interface IndexMap {
|
|
345
|
-
[modelID: string]: {
|
|
346
|
-
[expressID: string]: Set<number>;
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
350
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
351
|
-
/** {@link Disposable.onDisposed} */
|
|
352
|
-
readonly onDisposed: Event<string>;
|
|
353
|
-
enabled: boolean;
|
|
354
|
-
relationsToProcess: number[];
|
|
355
|
-
indexMap: IndexMap;
|
|
356
|
-
private _propertiesManager;
|
|
357
|
-
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
358
|
-
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
359
|
-
get propertiesManager(): IfcPropertiesManager | null;
|
|
360
|
-
constructor(components: Components);
|
|
361
|
-
private onFragmentsDisposed;
|
|
362
|
-
dispose(): Promise<void>;
|
|
363
|
-
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
364
|
-
private getNestedPsets;
|
|
365
|
-
private getPsetProperties;
|
|
366
|
-
process(model: FragmentsGroup): Promise<void>;
|
|
367
|
-
private setEntityIndex;
|
|
368
|
-
private cloneProperty;
|
|
369
|
-
private clonePropertyArray;
|
|
370
|
-
}
|
|
371
|
-
export {};
|
|
372
|
-
import * as FRAGS from "bim-fragment";
|
|
373
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
374
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
375
|
-
import { QueryGroup } from "./src/types";
|
|
376
|
-
export interface QueryResult {
|
|
377
|
-
[modelID: string]: {
|
|
378
|
-
modelEntities: Set<number>;
|
|
379
|
-
otherEntities: Set<number>;
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
export interface IndexedModels {
|
|
383
|
-
[modelID: string]: {
|
|
384
|
-
[expressID: number]: Set<number>;
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
388
|
-
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
389
|
-
/** {@link Disposable.onDisposed} */
|
|
390
|
-
readonly onDisposed: Event<unknown>;
|
|
391
|
-
enabled: boolean;
|
|
392
|
-
indexedModels: IndexedModels;
|
|
393
|
-
private readonly _conditionFunctions;
|
|
394
|
-
private _noHandleAttributes;
|
|
395
|
-
constructor(components: Components);
|
|
396
|
-
private onFragmentsDisposed;
|
|
397
|
-
dispose(): void;
|
|
398
|
-
private indexEntityRelations;
|
|
399
|
-
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
400
|
-
private toFragmentMap;
|
|
401
|
-
private simpleQuery;
|
|
402
|
-
private getMatchingEntities;
|
|
403
|
-
private combineArrays;
|
|
404
|
-
private getCommonElements;
|
|
405
|
-
private arrayIntersection;
|
|
406
|
-
private arrayUnion;
|
|
407
|
-
private getConditionFunctions;
|
|
408
|
-
}
|
|
409
325
|
import * as THREE from "three";
|
|
410
326
|
import * as FRAGS from "bim-fragment";
|
|
411
327
|
import { FragmentsGroup } from "bim-fragment";
|
|
@@ -442,6 +358,21 @@ export declare class FragmentBoundingBox extends Component implements Disposable
|
|
|
442
358
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
443
359
|
private static getFragmentBounds;
|
|
444
360
|
}
|
|
361
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
362
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
363
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
364
|
+
enabled: boolean;
|
|
365
|
+
height: number;
|
|
366
|
+
groupName: string;
|
|
367
|
+
/** {@link Disposable.onDisposed} */
|
|
368
|
+
readonly onDisposed: Event<string>;
|
|
369
|
+
list: Set<string>;
|
|
370
|
+
constructor(components: Components);
|
|
371
|
+
dispose(): void;
|
|
372
|
+
explode(): void;
|
|
373
|
+
reset(): void;
|
|
374
|
+
update(): void;
|
|
375
|
+
}
|
|
445
376
|
import * as FRAGS from "bim-fragment";
|
|
446
377
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
447
378
|
export interface Classification {
|
|
@@ -472,79 +403,48 @@ export declare class FragmentClassifier extends Component implements Disposable
|
|
|
472
403
|
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
473
404
|
private saveItem;
|
|
474
405
|
}
|
|
475
|
-
import * as
|
|
476
|
-
import {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
interface AttributeListener {
|
|
485
|
-
[modelID: string]: {
|
|
486
|
-
[expressID: number]: {
|
|
487
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
488
|
-
};
|
|
489
|
-
};
|
|
406
|
+
import * as FRAGS from "bim-fragment";
|
|
407
|
+
import { Components, Component } from "../../core";
|
|
408
|
+
export declare class FragmentHider extends Component {
|
|
409
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
410
|
+
enabled: boolean;
|
|
411
|
+
constructor(components: Components);
|
|
412
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
413
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
414
|
+
private updateCulledVisibility;
|
|
490
415
|
}
|
|
491
|
-
|
|
492
|
-
|
|
416
|
+
import * as WEBIFC from "web-ifc";
|
|
417
|
+
import * as FRAGS from "bim-fragment";
|
|
418
|
+
import { IfcFragmentSettings } from "./src";
|
|
419
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
420
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
421
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
422
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
423
|
+
readonly onSetup: Event<void>;
|
|
493
424
|
/** {@link Disposable.onDisposed} */
|
|
494
425
|
readonly onDisposed: Event<string>;
|
|
495
|
-
|
|
496
|
-
ifcToExport: ArrayBuffer | null;
|
|
497
|
-
readonly onElementToPset: Event<{
|
|
498
|
-
model: FragmentsGroup;
|
|
499
|
-
psetID: number;
|
|
500
|
-
elementID: number;
|
|
501
|
-
}>;
|
|
502
|
-
readonly onPropToPset: Event<{
|
|
503
|
-
model: FragmentsGroup;
|
|
504
|
-
psetID: number;
|
|
505
|
-
propID: number;
|
|
506
|
-
}>;
|
|
507
|
-
readonly onPsetRemoved: Event<{
|
|
508
|
-
model: FragmentsGroup;
|
|
509
|
-
psetID: number;
|
|
510
|
-
}>;
|
|
511
|
-
readonly onDataChanged: Event<{
|
|
512
|
-
model: FragmentsGroup;
|
|
513
|
-
expressID: number;
|
|
514
|
-
}>;
|
|
515
|
-
wasm: {
|
|
516
|
-
path: string;
|
|
517
|
-
absolute: boolean;
|
|
518
|
-
};
|
|
426
|
+
settings: IfcFragmentSettings;
|
|
519
427
|
enabled: boolean;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
private
|
|
428
|
+
webIfc: WEBIFC.IfcAPI;
|
|
429
|
+
private _material;
|
|
430
|
+
private _spatialTree;
|
|
431
|
+
private _metaData;
|
|
432
|
+
private _fragmentInstances;
|
|
433
|
+
private _civil;
|
|
434
|
+
private _propertyExporter;
|
|
435
|
+
private _visitedFragments;
|
|
436
|
+
private _materialT;
|
|
523
437
|
constructor(components: Components);
|
|
524
|
-
get(): ChangeMap;
|
|
525
438
|
dispose(): void;
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
private
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
535
|
-
}>;
|
|
536
|
-
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
537
|
-
private newSingleProperty;
|
|
538
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
539
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
540
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
541
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
542
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
543
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
544
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
545
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
439
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
440
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
441
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
442
|
+
private getAllGeometries;
|
|
443
|
+
cleanUp(): void;
|
|
444
|
+
private getMesh;
|
|
445
|
+
private getGeometry;
|
|
446
|
+
private autoSetWasm;
|
|
546
447
|
}
|
|
547
|
-
export {};
|
|
548
448
|
import { Fragment, FragmentsGroup } from "bim-fragment";
|
|
549
449
|
import * as THREE from "three";
|
|
550
450
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
@@ -589,37 +489,54 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
589
489
|
export(group: FragmentsGroup): Uint8Array;
|
|
590
490
|
coordinate(models?: FragmentsGroup[]): void;
|
|
591
491
|
}
|
|
592
|
-
import * as
|
|
593
|
-
import
|
|
594
|
-
import {
|
|
595
|
-
import {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
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;
|
|
613
513
|
constructor(components: Components);
|
|
514
|
+
/** {@link Disposable.dispose} */
|
|
614
515
|
dispose(): void;
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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;
|
|
623
540
|
}
|
|
624
541
|
import * as THREE from "three";
|
|
625
542
|
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
@@ -633,15 +550,266 @@ import * as THREE from "three";
|
|
|
633
550
|
export declare class MaterialsUtils {
|
|
634
551
|
static isTransparent(material: THREE.Material): boolean;
|
|
635
552
|
}
|
|
553
|
+
import * as THREE from "three";
|
|
554
|
+
export interface MeasureEdge {
|
|
555
|
+
distance: number;
|
|
556
|
+
points: THREE.Vector3[];
|
|
557
|
+
}
|
|
558
|
+
export declare class MeasurementUtils {
|
|
559
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
560
|
+
edges: MeasureEdge[];
|
|
561
|
+
indices: Set<number>;
|
|
562
|
+
} | null;
|
|
563
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
564
|
+
private static getFaceData;
|
|
565
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
566
|
+
p1: THREE.Vector3;
|
|
567
|
+
p2: THREE.Vector3;
|
|
568
|
+
p3: THREE.Vector3;
|
|
569
|
+
faceNormal: THREE.Vector3;
|
|
570
|
+
};
|
|
571
|
+
private static round;
|
|
572
|
+
}
|
|
636
573
|
export declare class UUID {
|
|
637
574
|
private static _pattern;
|
|
638
575
|
private static _lut;
|
|
639
576
|
static create(): string;
|
|
640
577
|
static validate(uuid: string): void;
|
|
641
578
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
579
|
+
import * as THREE from "three";
|
|
580
|
+
import { Component, Components, Event, World, Disposable } from "../core";
|
|
581
|
+
export interface VertexPickerConfig {
|
|
582
|
+
showOnlyVertex: boolean;
|
|
583
|
+
snapDistance: number;
|
|
584
|
+
previewElement: HTMLElement;
|
|
585
|
+
}
|
|
586
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
587
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
588
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
589
|
+
components: Components;
|
|
590
|
+
private _pickedPoint;
|
|
591
|
+
private _config;
|
|
592
|
+
private _enabled;
|
|
593
|
+
private _workingPlane;
|
|
594
|
+
/** {@link Disposable.onDisposed} */
|
|
595
|
+
readonly onDisposed: Event<unknown>;
|
|
596
|
+
set enabled(value: boolean);
|
|
597
|
+
get enabled(): boolean;
|
|
598
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
599
|
+
[Symbol.dispose](): void;
|
|
600
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
601
|
+
get workingPlane(): THREE.Plane | null;
|
|
602
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
603
|
+
get config(): Partial<VertexPickerConfig>;
|
|
604
|
+
dispose(): void;
|
|
605
|
+
get(world: World): THREE.Vector3 | null;
|
|
606
|
+
private getClosestVertex;
|
|
607
|
+
private getVertices;
|
|
608
|
+
private getVertex;
|
|
609
|
+
}
|
|
610
|
+
import * as FRAGS from "bim-fragment";
|
|
611
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
612
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
613
|
+
import { QueryGroup } from "./src/types";
|
|
614
|
+
export interface QueryResult {
|
|
615
|
+
[modelID: string]: {
|
|
616
|
+
modelEntities: Set<number>;
|
|
617
|
+
otherEntities: Set<number>;
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
export interface IndexedModels {
|
|
621
|
+
[modelID: string]: {
|
|
622
|
+
[expressID: number]: Set<number>;
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
626
|
+
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
627
|
+
/** {@link Disposable.onDisposed} */
|
|
628
|
+
readonly onDisposed: Event<unknown>;
|
|
629
|
+
enabled: boolean;
|
|
630
|
+
indexedModels: IndexedModels;
|
|
631
|
+
private readonly _conditionFunctions;
|
|
632
|
+
private _noHandleAttributes;
|
|
633
|
+
constructor(components: Components);
|
|
634
|
+
private onFragmentsDisposed;
|
|
635
|
+
dispose(): void;
|
|
636
|
+
private indexEntityRelations;
|
|
637
|
+
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
638
|
+
private toFragmentMap;
|
|
639
|
+
private simpleQuery;
|
|
640
|
+
private getMatchingEntities;
|
|
641
|
+
private combineArrays;
|
|
642
|
+
private getCommonElements;
|
|
643
|
+
private arrayIntersection;
|
|
644
|
+
private arrayUnion;
|
|
645
|
+
private getConditionFunctions;
|
|
646
|
+
}
|
|
647
|
+
import * as WEBIFC from "web-ifc";
|
|
648
|
+
import * as FRAG from "bim-fragment";
|
|
649
|
+
/**
|
|
650
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
651
|
+
*/
|
|
652
|
+
export declare class IfcJsonExporter {
|
|
653
|
+
/**
|
|
654
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
655
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
656
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
657
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
658
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
659
|
+
* to make the location data available (e.g. absolute position of building).
|
|
660
|
+
*/
|
|
661
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
662
|
+
}
|
|
663
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
664
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
665
|
+
interface RelationMap {
|
|
666
|
+
[modelID: string]: Map<number, Map<number, number[]>>;
|
|
667
|
+
}
|
|
668
|
+
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
669
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
670
|
+
/** {@link Disposable.onDisposed} */
|
|
671
|
+
readonly onDisposed: Event<string>;
|
|
672
|
+
enabled: boolean;
|
|
673
|
+
/**
|
|
674
|
+
* All the inverse attributes this component can processes.
|
|
675
|
+
*/
|
|
676
|
+
readonly inverseAttributes: string[];
|
|
677
|
+
inverseAttributesToProcess: string[];
|
|
678
|
+
private _relToAttributesMap;
|
|
679
|
+
readonly relationMaps: RelationMap;
|
|
680
|
+
constructor(components: Components);
|
|
681
|
+
private onFragmentsDisposed;
|
|
682
|
+
private getAttributeRels;
|
|
683
|
+
private setRelMap;
|
|
684
|
+
/**
|
|
685
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
686
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
687
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
688
|
+
*
|
|
689
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
690
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
691
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
692
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
693
|
+
* of entities that are related through that attribute.
|
|
694
|
+
*
|
|
695
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
696
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
697
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
698
|
+
* @throws An error if the model does not have properties loaded.
|
|
699
|
+
*/
|
|
700
|
+
process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>;
|
|
701
|
+
/**
|
|
702
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
703
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
704
|
+
* returning the IDs of related entities if a match is found.
|
|
705
|
+
*
|
|
706
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
707
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
708
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
709
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
710
|
+
* or the specified relation name is not indexed.
|
|
711
|
+
*/
|
|
712
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null;
|
|
713
|
+
/**
|
|
714
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
715
|
+
* This method iterates through the relations indexed for the given model,
|
|
716
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
717
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
718
|
+
* The resulting object is then serialized into a JSON string.
|
|
719
|
+
*
|
|
720
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
721
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
722
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
723
|
+
*/
|
|
724
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
725
|
+
/**
|
|
726
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
727
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
728
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
729
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
730
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
731
|
+
*
|
|
732
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
733
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
734
|
+
*/
|
|
735
|
+
serializeRelations(): string;
|
|
736
|
+
getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>;
|
|
737
|
+
dispose(): void;
|
|
738
|
+
}
|
|
739
|
+
export {};
|
|
740
|
+
import * as WEBIFC from "web-ifc";
|
|
741
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
742
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
743
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
744
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
745
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
746
|
+
interface ChangeMap {
|
|
747
|
+
[modelID: string]: Set<number>;
|
|
748
|
+
}
|
|
749
|
+
interface AttributeListener {
|
|
750
|
+
[modelID: string]: {
|
|
751
|
+
[expressID: number]: {
|
|
752
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
753
|
+
};
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
757
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
758
|
+
/** {@link Disposable.onDisposed} */
|
|
759
|
+
readonly onDisposed: Event<string>;
|
|
760
|
+
readonly onRequestFile: Event<unknown>;
|
|
761
|
+
ifcToExport: ArrayBuffer | null;
|
|
762
|
+
readonly onElementToPset: Event<{
|
|
763
|
+
model: FragmentsGroup;
|
|
764
|
+
psetID: number;
|
|
765
|
+
elementID: number;
|
|
766
|
+
}>;
|
|
767
|
+
readonly onPropToPset: Event<{
|
|
768
|
+
model: FragmentsGroup;
|
|
769
|
+
psetID: number;
|
|
770
|
+
propID: number;
|
|
771
|
+
}>;
|
|
772
|
+
readonly onPsetRemoved: Event<{
|
|
773
|
+
model: FragmentsGroup;
|
|
774
|
+
psetID: number;
|
|
775
|
+
}>;
|
|
776
|
+
readonly onDataChanged: Event<{
|
|
777
|
+
model: FragmentsGroup;
|
|
778
|
+
expressID: number;
|
|
779
|
+
}>;
|
|
780
|
+
wasm: {
|
|
781
|
+
path: string;
|
|
782
|
+
absolute: boolean;
|
|
783
|
+
};
|
|
784
|
+
enabled: boolean;
|
|
785
|
+
attributeListeners: AttributeListener;
|
|
786
|
+
selectedModel?: FragmentsGroup;
|
|
787
|
+
private _changeMap;
|
|
788
|
+
constructor(components: Components);
|
|
789
|
+
get(): ChangeMap;
|
|
790
|
+
dispose(): void;
|
|
791
|
+
private increaseMaxID;
|
|
792
|
+
static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
|
|
793
|
+
private newGUID;
|
|
794
|
+
private getOwnerHistory;
|
|
795
|
+
private registerChange;
|
|
796
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
797
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
798
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
799
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
800
|
+
}>;
|
|
801
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
802
|
+
private newSingleProperty;
|
|
803
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
804
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
805
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
806
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
807
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
808
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
809
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
810
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
811
|
+
}
|
|
812
|
+
export {};
|
|
645
813
|
import * as WEBIFC from "web-ifc";
|
|
646
814
|
export interface IfcItemsCategories {
|
|
647
815
|
[itemID: number]: number;
|
|
@@ -649,6 +817,9 @@ export interface IfcItemsCategories {
|
|
|
649
817
|
export declare class IfcCategories {
|
|
650
818
|
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
651
819
|
}
|
|
820
|
+
export declare const IfcElements: {
|
|
821
|
+
[key: number]: string;
|
|
822
|
+
};
|
|
652
823
|
export declare const IfcCategoryMap: {
|
|
653
824
|
[key: number]: string;
|
|
654
825
|
};
|
|
@@ -677,524 +848,38 @@ export declare class IfcPropertiesUtils {
|
|
|
677
848
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
678
849
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
679
850
|
}
|
|
851
|
+
export declare const GeometryTypes: Set<number>;
|
|
680
852
|
import * as THREE from "three";
|
|
681
|
-
import
|
|
853
|
+
import CameraControls from "camera-controls";
|
|
854
|
+
import { Event } from "./event";
|
|
682
855
|
/**
|
|
683
|
-
*
|
|
684
|
-
* to
|
|
685
|
-
* [
|
|
686
|
-
*
|
|
856
|
+
* Whether this component has to be manually destroyed once you are done with
|
|
857
|
+
* it to prevent
|
|
858
|
+
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
859
|
+
* This also ensures that the DOM events created by that component will be
|
|
860
|
+
* cleaned up.
|
|
687
861
|
*/
|
|
688
|
-
export
|
|
689
|
-
dom: HTMLCanvasElement;
|
|
690
|
-
private _event?;
|
|
691
|
-
private _position;
|
|
692
|
-
/** {@link Disposable.onDisposed} */
|
|
693
|
-
readonly onDisposed: Event<unknown>;
|
|
694
|
-
constructor(dom: HTMLCanvasElement);
|
|
862
|
+
export interface Disposable {
|
|
695
863
|
/**
|
|
696
|
-
*
|
|
864
|
+
* Destroys the object from memory to prevent a
|
|
865
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
697
866
|
*/
|
|
698
|
-
|
|
699
|
-
/** {@link Disposable.dispose}
|
|
700
|
-
|
|
701
|
-
private getPositionY;
|
|
702
|
-
private getPositionX;
|
|
703
|
-
private updateMouseInfo;
|
|
704
|
-
private setupEvents;
|
|
867
|
+
dispose: () => void | Promise<void>;
|
|
868
|
+
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
869
|
+
readonly onDisposed: Event<any>;
|
|
705
870
|
}
|
|
706
|
-
import * as THREE from "three";
|
|
707
|
-
import { Components } from "../../Components";
|
|
708
|
-
import { Event, World, Disposable } from "../../Types";
|
|
709
|
-
import { Mouse } from "./mouse";
|
|
710
871
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
872
|
+
* Whether the geometric representation of this component can be
|
|
873
|
+
* hidden or shown in the
|
|
874
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
714
875
|
*/
|
|
715
|
-
export
|
|
716
|
-
/** {@link Component.enabled} */
|
|
717
|
-
enabled: boolean;
|
|
718
|
-
components: Components;
|
|
719
|
-
/** {@link Disposable.onDisposed} */
|
|
720
|
-
readonly onDisposed: Event<unknown>;
|
|
721
|
-
/** The position of the mouse in the screen. */
|
|
722
|
-
readonly mouse: Mouse;
|
|
723
|
-
readonly three: THREE.Raycaster;
|
|
724
|
-
world: World;
|
|
725
|
-
constructor(components: Components, world: World);
|
|
726
|
-
/** {@link Disposable.dispose} */
|
|
727
|
-
dispose(): void;
|
|
876
|
+
export interface Hideable {
|
|
728
877
|
/**
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
733
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
734
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
735
|
-
* {@link Components.meshes}.
|
|
878
|
+
* Whether the geometric representation of this component is
|
|
879
|
+
* currently visible or not in the
|
|
880
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
736
881
|
*/
|
|
737
|
-
|
|
738
|
-
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;
|
|
739
|
-
private intersect;
|
|
740
|
-
private filterClippingPlanes;
|
|
741
|
-
}
|
|
742
|
-
export declare const GeometryTypes: Set<number>;
|
|
743
|
-
import * as WEBIFC from "web-ifc";
|
|
744
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
745
|
-
export declare class SpatialStructure {
|
|
746
|
-
itemsByFloor: IfcItemsCategories;
|
|
747
|
-
private _units;
|
|
748
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
749
|
-
cleanUp(): void;
|
|
750
|
-
}
|
|
751
|
-
import * as THREE from "three";
|
|
752
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
753
|
-
import { Components } from "../../Components";
|
|
754
|
-
/**
|
|
755
|
-
* Each of the planes created by {@link SimpleClipper}.
|
|
756
|
-
*/
|
|
757
|
-
export declare class SimplePlane implements Disposable, Hideable {
|
|
758
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
759
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
760
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
761
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
762
|
-
/** {@link Disposable.onDisposed} */
|
|
763
|
-
readonly onDisposed: Event<unknown>;
|
|
764
|
-
readonly normal: THREE.Vector3;
|
|
765
|
-
readonly origin: THREE.Vector3;
|
|
766
|
-
readonly three: THREE.Plane;
|
|
767
|
-
protected readonly _helper: THREE.Object3D;
|
|
768
|
-
protected _visible: boolean;
|
|
769
|
-
protected _enabled: boolean;
|
|
770
|
-
components: Components;
|
|
771
|
-
world: World;
|
|
772
|
-
private _controlsActive;
|
|
773
|
-
private readonly _arrowBoundBox;
|
|
774
|
-
private readonly _planeMesh;
|
|
775
|
-
private readonly _controls;
|
|
776
|
-
private readonly _hiddenMaterial;
|
|
777
|
-
get enabled(): boolean;
|
|
778
|
-
/** {@link Component.enabled} */
|
|
779
|
-
set enabled(state: boolean);
|
|
780
|
-
/** {@link Hideable.visible } */
|
|
781
|
-
get visible(): boolean;
|
|
782
|
-
/** {@link Hideable.visible } */
|
|
783
|
-
set visible(state: boolean);
|
|
784
|
-
/** The meshes used for raycasting */
|
|
785
|
-
get meshes(): THREE.Mesh[];
|
|
786
|
-
/** The material of the clipping plane representation. */
|
|
787
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
788
|
-
/** The material of the clipping plane representation. */
|
|
789
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
790
|
-
/** The size of the clipping plane representation. */
|
|
791
|
-
get size(): number;
|
|
792
|
-
/** Sets the size of the clipping plane representation. */
|
|
793
|
-
set size(size: number);
|
|
794
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
795
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
796
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
797
|
-
/** {@link Updateable.update} */
|
|
798
|
-
update: () => Promise<void>;
|
|
799
|
-
/** {@link Disposable.dispose} */
|
|
800
|
-
dispose(): void;
|
|
801
|
-
private reset;
|
|
802
|
-
protected toggleControls(state: boolean): void;
|
|
803
|
-
private newTransformControls;
|
|
804
|
-
private initializeControls;
|
|
805
|
-
private createArrowBoundingBox;
|
|
806
|
-
private changeDrag;
|
|
807
|
-
private notifyDraggingChanged;
|
|
808
|
-
private preventCameraMovement;
|
|
809
|
-
private newHelper;
|
|
810
|
-
private static newPlaneMesh;
|
|
811
|
-
}
|
|
812
|
-
import * as THREE from "three";
|
|
813
|
-
import { Components } from "../../Components";
|
|
814
|
-
import { Event, World } from "../../Types";
|
|
815
|
-
export interface CullerRendererSettings {
|
|
816
|
-
updateInterval?: number;
|
|
817
|
-
width?: number;
|
|
818
|
-
height?: number;
|
|
819
|
-
autoUpdate?: boolean;
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* A base renderer to determine visibility on screen
|
|
823
|
-
*/
|
|
824
|
-
export declare class CullerRenderer {
|
|
825
|
-
/** {@link Disposable.onDisposed} */
|
|
826
|
-
readonly onDisposed: Event<string>;
|
|
827
|
-
/**
|
|
828
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
829
|
-
* meshes that are currently visible, and the ones that were visible
|
|
830
|
-
* just before but not anymore.
|
|
831
|
-
*/
|
|
832
|
-
readonly onViewUpdated: Event<any>;
|
|
833
|
-
/** {@link Component.enabled} */
|
|
834
|
-
enabled: boolean;
|
|
835
|
-
/**
|
|
836
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
837
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
838
|
-
*/
|
|
839
|
-
needsUpdate: boolean;
|
|
840
|
-
/**
|
|
841
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
842
|
-
* for debugging purposes.
|
|
843
|
-
*/
|
|
844
|
-
renderDebugFrame: boolean;
|
|
845
|
-
components: Components;
|
|
846
|
-
readonly world: World;
|
|
847
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
848
|
-
protected autoUpdate: boolean;
|
|
849
|
-
protected updateInterval: number;
|
|
850
|
-
protected readonly worker: Worker;
|
|
851
|
-
protected readonly scene: THREE.Scene;
|
|
852
|
-
private _width;
|
|
853
|
-
private _height;
|
|
854
|
-
private _availableColor;
|
|
855
|
-
private readonly renderTarget;
|
|
856
|
-
private readonly bufferSize;
|
|
857
|
-
private readonly _buffer;
|
|
858
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
859
|
-
/** {@link Disposable.dispose} */
|
|
860
|
-
dispose(): void;
|
|
861
|
-
/**
|
|
862
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
863
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
864
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
865
|
-
* not true.
|
|
866
|
-
*/
|
|
867
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
868
|
-
protected getAvailableColor(): {
|
|
869
|
-
r: number;
|
|
870
|
-
g: number;
|
|
871
|
-
b: number;
|
|
872
|
-
code: string;
|
|
873
|
-
};
|
|
874
|
-
protected increaseColor(): void;
|
|
875
|
-
protected decreaseColor(): void;
|
|
876
|
-
private applySettings;
|
|
877
|
-
}
|
|
878
|
-
import * as THREE from "three";
|
|
879
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
880
|
-
import { Components } from "../../Components";
|
|
881
|
-
import { Event, World } from "../../Types";
|
|
882
|
-
/**
|
|
883
|
-
* A renderer to determine a mesh visibility on screen
|
|
884
|
-
*/
|
|
885
|
-
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
886
|
-
threshold: number;
|
|
887
|
-
readonly onViewUpdated: Event<{
|
|
888
|
-
seen: Set<THREE.Mesh>;
|
|
889
|
-
unseen: Set<THREE.Mesh>;
|
|
890
|
-
}>;
|
|
891
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
892
|
-
isProcessing: boolean;
|
|
893
|
-
private _colorCodeMeshMap;
|
|
894
|
-
private _meshIDColorCodeMap;
|
|
895
|
-
private _currentVisibleMeshes;
|
|
896
|
-
private _recentlyHiddenMeshes;
|
|
897
|
-
private readonly _transparentMat;
|
|
898
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
899
|
-
dispose(): void;
|
|
900
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
901
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
902
|
-
private handleWorkerMessage;
|
|
903
|
-
private getAvailableMaterial;
|
|
904
|
-
}
|
|
905
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
906
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
907
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
908
|
-
minGeometrySize: number;
|
|
909
|
-
minAssetsSize: number;
|
|
910
|
-
}
|
|
911
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
912
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
913
|
-
propertiesSize: number;
|
|
914
|
-
}
|
|
915
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
916
|
-
import * as WEBIFC from "web-ifc";
|
|
917
|
-
import { Component, Disposable, Event } from "../../../core";
|
|
918
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
919
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
920
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
921
|
-
onPropertiesStreamed: Event<{
|
|
922
|
-
type: number;
|
|
923
|
-
data: {
|
|
924
|
-
[id: number]: any;
|
|
925
|
-
};
|
|
926
|
-
}>;
|
|
927
|
-
onProgress: Event<number>;
|
|
928
|
-
onIndicesStreamed: Event<number[][]>;
|
|
929
|
-
/** {@link Disposable.onDisposed} */
|
|
930
|
-
readonly onDisposed: Event<string>;
|
|
931
|
-
enabled: boolean;
|
|
932
|
-
settings: PropertiesStreamingSettings;
|
|
933
|
-
webIfc: WEBIFC.IfcAPI;
|
|
934
|
-
dispose(): Promise<void>;
|
|
935
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
936
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
937
|
-
private readIfcFile;
|
|
938
|
-
private streamIfcFile;
|
|
939
|
-
private streamAllProperties;
|
|
940
|
-
private getIndices;
|
|
941
|
-
private cleanUp;
|
|
942
|
-
}
|
|
943
|
-
import * as WEBIFC from "web-ifc";
|
|
944
|
-
import { Components, Disposable, Event, Component } from "../../../core";
|
|
945
|
-
import { IfcStreamingSettings } from "./streaming-settings";
|
|
946
|
-
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
947
|
-
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
948
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
949
|
-
onGeometryStreamed: Event<{
|
|
950
|
-
buffer: Uint8Array;
|
|
951
|
-
data: StreamedGeometries;
|
|
952
|
-
}>;
|
|
953
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
954
|
-
onProgress: Event<number>;
|
|
955
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
956
|
-
/** {@link Disposable.onDisposed} */
|
|
957
|
-
readonly onDisposed: Event<unknown>;
|
|
958
|
-
settings: IfcStreamingSettings;
|
|
959
|
-
enabled: boolean;
|
|
960
|
-
webIfc: WEBIFC.IfcAPI;
|
|
961
|
-
private _spatialTree;
|
|
962
|
-
private _metaData;
|
|
963
|
-
private _visitedGeometries;
|
|
964
|
-
private _streamSerializer;
|
|
965
|
-
private _geometries;
|
|
966
|
-
private _geometryCount;
|
|
967
|
-
private _civil;
|
|
968
|
-
private _groupSerializer;
|
|
969
|
-
private _assets;
|
|
970
|
-
private _meshesWithHoles;
|
|
971
|
-
constructor(components: Components);
|
|
972
|
-
dispose(): void;
|
|
973
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
974
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
975
|
-
private readIfcFile;
|
|
976
|
-
private streamIfcFile;
|
|
977
|
-
private streamAllGeometries;
|
|
978
|
-
private cleanUp;
|
|
979
|
-
private getMesh;
|
|
980
|
-
private getGeometry;
|
|
981
|
-
private streamAssets;
|
|
982
|
-
private streamGeometries;
|
|
983
|
-
}
|
|
984
|
-
export interface StreamedGeometries {
|
|
985
|
-
[id: number]: {
|
|
986
|
-
boundingBox: Float32Array;
|
|
987
|
-
hasHoles: boolean;
|
|
988
|
-
geometryFile?: string;
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
export interface StreamedAsset {
|
|
992
|
-
id: number;
|
|
993
|
-
geometries: {
|
|
994
|
-
geometryID: number;
|
|
995
|
-
transformation: number[];
|
|
996
|
-
color: number[];
|
|
997
|
-
}[];
|
|
998
|
-
}
|
|
999
|
-
import * as THREE from "three";
|
|
1000
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
1001
|
-
import { Components } from "../../Components";
|
|
1002
|
-
/**
|
|
1003
|
-
* A basic renderer capable of rendering
|
|
1004
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1005
|
-
*/
|
|
1006
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1007
|
-
/** {@link Component.enabled} */
|
|
1008
|
-
enabled: boolean;
|
|
1009
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1010
|
-
container: HTMLElement | null;
|
|
1011
|
-
three: THREE.WebGLRenderer;
|
|
1012
|
-
protected _canvas: HTMLCanvasElement;
|
|
1013
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1014
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1015
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1016
|
-
/** {@link Updateable.update} */
|
|
1017
|
-
update(): void;
|
|
1018
|
-
/** {@link Disposable.dispose} */
|
|
1019
|
-
dispose(): void;
|
|
1020
|
-
/** {@link Resizeable.getSize}. */
|
|
1021
|
-
getSize(): THREE.Vector2;
|
|
1022
|
-
/** {@link Resizeable.resize} */
|
|
1023
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1024
|
-
setupEvents(active: boolean): void;
|
|
1025
|
-
private resizeEvent;
|
|
1026
|
-
private setupRenderer;
|
|
1027
|
-
private onContextLost;
|
|
1028
|
-
private onContextBack;
|
|
1029
|
-
private updateContainer;
|
|
1030
|
-
}
|
|
1031
|
-
import * as THREE from "three";
|
|
1032
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1033
|
-
import { Components } from "../../Components";
|
|
1034
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1035
|
-
/**
|
|
1036
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1037
|
-
*/
|
|
1038
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1039
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1040
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1041
|
-
enabled: boolean;
|
|
1042
|
-
uuid: string;
|
|
1043
|
-
readonly onDisposed: Event<unknown>;
|
|
1044
|
-
private _scene?;
|
|
1045
|
-
private _camera?;
|
|
1046
|
-
private _renderer;
|
|
1047
|
-
get scene(): T;
|
|
1048
|
-
set scene(scene: T);
|
|
1049
|
-
get camera(): U;
|
|
1050
|
-
set camera(camera: U);
|
|
1051
|
-
get renderer(): S | null;
|
|
1052
|
-
set renderer(renderer: S | null);
|
|
1053
|
-
constructor(components: Components);
|
|
1054
|
-
update(delta?: number): void;
|
|
1055
|
-
dispose(disposeResources?: boolean): void;
|
|
1056
|
-
}
|
|
1057
|
-
import * as THREE from "three";
|
|
1058
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1059
|
-
import { Components } from "../../Components";
|
|
1060
|
-
export interface SimpleSceneConfig {
|
|
1061
|
-
directionalLight: {
|
|
1062
|
-
color: THREE.Color;
|
|
1063
|
-
intensity: number;
|
|
1064
|
-
position: THREE.Vector3;
|
|
1065
|
-
};
|
|
1066
|
-
ambientLight: {
|
|
1067
|
-
color: THREE.Color;
|
|
1068
|
-
intensity: number;
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
/**
|
|
1072
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1073
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1074
|
-
* @noInheritDoc
|
|
1075
|
-
*/
|
|
1076
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1077
|
-
/** {@link Configurable.isSetup} */
|
|
1078
|
-
isSetup: boolean;
|
|
1079
|
-
three: THREE.Scene;
|
|
1080
|
-
/** {@link Configurable.onSetup} */
|
|
1081
|
-
readonly onSetup: Event<SimpleScene>;
|
|
1082
|
-
config: Required<SimpleSceneConfig>;
|
|
1083
|
-
constructor(components: Components);
|
|
1084
|
-
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1085
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1086
|
-
}
|
|
1087
|
-
import * as THREE from "three";
|
|
1088
|
-
import CameraControls from "camera-controls";
|
|
1089
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1090
|
-
import { Components } from "../../Components";
|
|
1091
|
-
/**
|
|
1092
|
-
* A basic camera that uses
|
|
1093
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1094
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1095
|
-
* what features it offers.
|
|
1096
|
-
*/
|
|
1097
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1098
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1099
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1100
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1101
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1102
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1103
|
-
/** {@link Disposable.onDisposed} */
|
|
1104
|
-
readonly onDisposed: Event<string>;
|
|
1105
|
-
readonly three: THREE.PerspectiveCamera;
|
|
1106
|
-
private _allControls;
|
|
1107
|
-
/**
|
|
1108
|
-
* The object that controls the camera. An instance of
|
|
1109
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1110
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1111
|
-
* object to move, rotate, look at objects, etc.
|
|
1112
|
-
*/
|
|
1113
|
-
get controls(): CameraControls;
|
|
1114
|
-
/** {@link Component.enabled} */
|
|
1115
|
-
get enabled(): boolean;
|
|
1116
|
-
/** {@link Component.enabled} */
|
|
1117
|
-
set enabled(enabled: boolean);
|
|
1118
|
-
constructor(components: Components);
|
|
1119
|
-
/** {@link Disposable.dispose} */
|
|
1120
|
-
dispose(): void;
|
|
1121
|
-
/** {@link Updateable.update} */
|
|
1122
|
-
update(_delta: number): void;
|
|
1123
|
-
/**
|
|
1124
|
-
* Updates the aspect of the camera to match the size of the
|
|
1125
|
-
* {@link Components.renderer}.
|
|
1126
|
-
*/
|
|
1127
|
-
updateAspect: () => void;
|
|
1128
|
-
private setupCamera;
|
|
1129
|
-
private newCameraControls;
|
|
1130
|
-
private setupEvents;
|
|
1131
|
-
private static getSubsetOfThree;
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Simple event handler by
|
|
1135
|
-
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1136
|
-
* Keep in mind that:
|
|
1137
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
1138
|
-
* an object.
|
|
1139
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1140
|
-
* the callback as an arrow function.
|
|
1141
|
-
*/
|
|
1142
|
-
export declare class Event<T> {
|
|
1143
|
-
/**
|
|
1144
|
-
* Add a callback to this event instance.
|
|
1145
|
-
* @param handler - the callback to be added to this event.
|
|
1146
|
-
*/
|
|
1147
|
-
add(handler: T extends void ? {
|
|
1148
|
-
(): void;
|
|
1149
|
-
} : {
|
|
1150
|
-
(data: T): void;
|
|
1151
|
-
}): void;
|
|
1152
|
-
/**
|
|
1153
|
-
* Removes a callback from this event instance.
|
|
1154
|
-
* @param handler - the callback to be removed from this event.
|
|
1155
|
-
*/
|
|
1156
|
-
remove(handler: T extends void ? {
|
|
1157
|
-
(): void;
|
|
1158
|
-
} : {
|
|
1159
|
-
(data: T): void;
|
|
1160
|
-
}): void;
|
|
1161
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
1162
|
-
trigger: (data?: T) => void;
|
|
1163
|
-
/** Gets rid of all the suscribed events. */
|
|
1164
|
-
reset(): void;
|
|
1165
|
-
private handlers;
|
|
1166
|
-
}
|
|
1167
|
-
import * as THREE from "three";
|
|
1168
|
-
import CameraControls from "camera-controls";
|
|
1169
|
-
import { Event } from "./event";
|
|
1170
|
-
/**
|
|
1171
|
-
* Whether this component has to be manually destroyed once you are done with
|
|
1172
|
-
* it to prevent
|
|
1173
|
-
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1174
|
-
* This also ensures that the DOM events created by that component will be
|
|
1175
|
-
* cleaned up.
|
|
1176
|
-
*/
|
|
1177
|
-
export interface Disposable {
|
|
1178
|
-
/**
|
|
1179
|
-
* Destroys the object from memory to prevent a
|
|
1180
|
-
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1181
|
-
*/
|
|
1182
|
-
dispose: () => void | Promise<void>;
|
|
1183
|
-
/** Fired after the tool has been {@link Disposable.dispose()} */
|
|
1184
|
-
readonly onDisposed: Event<any>;
|
|
1185
|
-
}
|
|
1186
|
-
/**
|
|
1187
|
-
* Whether the geometric representation of this component can be
|
|
1188
|
-
* hidden or shown in the
|
|
1189
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1190
|
-
*/
|
|
1191
|
-
export interface Hideable {
|
|
1192
|
-
/**
|
|
1193
|
-
* Whether the geometric representation of this component is
|
|
1194
|
-
* currently visible or not in the
|
|
1195
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1196
|
-
*/
|
|
1197
|
-
visible: boolean;
|
|
882
|
+
visible: boolean;
|
|
1198
883
|
}
|
|
1199
884
|
/**
|
|
1200
885
|
* Whether this component can be resized. The meaning of this can vary depending
|
|
@@ -1229,7 +914,7 @@ export interface Updateable {
|
|
|
1229
914
|
* Function used to update the state of this component each frame. For
|
|
1230
915
|
* instance, a renderer component will make a render each frame.
|
|
1231
916
|
*/
|
|
1232
|
-
update(delta?: number): void
|
|
917
|
+
update(delta?: number): void;
|
|
1233
918
|
}
|
|
1234
919
|
/** Basic type to describe the progress of any kind of process. */
|
|
1235
920
|
export interface Progress {
|
|
@@ -1244,31 +929,20 @@ export interface Progress {
|
|
|
1244
929
|
* dimensions.
|
|
1245
930
|
*/
|
|
1246
931
|
export interface Createable {
|
|
1247
|
-
readonly onBeforeCreate: Event<any>;
|
|
1248
932
|
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
1249
933
|
create: (data: any) => void;
|
|
1250
|
-
/** Fired after successfully calling {@link Createable.create} */
|
|
1251
|
-
readonly onAfterCreate: Event<any>;
|
|
1252
934
|
/**
|
|
1253
935
|
* Finish the creation process of the component, successfully creating an
|
|
1254
936
|
* instance of whatever the component creates.
|
|
1255
937
|
*/
|
|
1256
|
-
endCreation
|
|
1257
|
-
/** Fired before calling {@link Createable.cancelCreation}. */
|
|
1258
|
-
readonly onBeforeCancel: Event<any>;
|
|
938
|
+
endCreation?: (data: any) => void;
|
|
1259
939
|
/**
|
|
1260
940
|
* Cancels the creation process of the component, going back to the state
|
|
1261
941
|
* before starting to create.
|
|
1262
942
|
*/
|
|
1263
|
-
cancelCreation
|
|
1264
|
-
/** Fired after calling {@link Createable.cancelCreation}. */
|
|
1265
|
-
readonly onAfterCancel: Event<any>;
|
|
1266
|
-
/** Fired before calling {@link Createable.delete}. */
|
|
1267
|
-
readonly onBeforeDelete: Event<any>;
|
|
943
|
+
cancelCreation?: (data: any) => void;
|
|
1268
944
|
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
1269
945
|
delete: (data: any) => void;
|
|
1270
|
-
/** Fired after successfully calling {@link Createable.delete()} */
|
|
1271
|
-
readonly onAfterDelete: Event<any>;
|
|
1272
946
|
}
|
|
1273
947
|
/**
|
|
1274
948
|
* Whether this component supports to be configured.
|
|
@@ -1288,145 +962,548 @@ export interface Configurable<T extends Record<string, any>> {
|
|
|
1288
962
|
/**
|
|
1289
963
|
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
1290
964
|
*/
|
|
1291
|
-
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
1292
|
-
boundsTree: Object | undefined;
|
|
1293
|
-
disposeBoundsTree: () => void;
|
|
965
|
+
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
966
|
+
boundsTree: Object | undefined;
|
|
967
|
+
disposeBoundsTree: () => void;
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* Whether a camera uses the Camera Controls library.
|
|
971
|
+
*/
|
|
972
|
+
export interface CameraControllable {
|
|
973
|
+
controls: CameraControls;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Simple event handler by
|
|
977
|
+
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
978
|
+
* Keep in mind that:
|
|
979
|
+
* - If you want to remove it later, you might want to declare the callback as
|
|
980
|
+
* an object.
|
|
981
|
+
* - If you want to maintain the reference to 'this', you will need to declare
|
|
982
|
+
* the callback as an arrow function.
|
|
983
|
+
*/
|
|
984
|
+
export declare class Event<T> {
|
|
985
|
+
/**
|
|
986
|
+
* Add a callback to this event instance.
|
|
987
|
+
* @param handler - the callback to be added to this event.
|
|
988
|
+
*/
|
|
989
|
+
add(handler: T extends void ? {
|
|
990
|
+
(): void;
|
|
991
|
+
} : {
|
|
992
|
+
(data: T): void;
|
|
993
|
+
}): void;
|
|
994
|
+
/**
|
|
995
|
+
* Removes a callback from this event instance.
|
|
996
|
+
* @param handler - the callback to be removed from this event.
|
|
997
|
+
*/
|
|
998
|
+
remove(handler: T extends void ? {
|
|
999
|
+
(): void;
|
|
1000
|
+
} : {
|
|
1001
|
+
(data: T): void;
|
|
1002
|
+
}): void;
|
|
1003
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1004
|
+
trigger: (data?: T) => void;
|
|
1005
|
+
/** Gets rid of all the suscribed events. */
|
|
1006
|
+
reset(): void;
|
|
1007
|
+
private handlers;
|
|
1008
|
+
}
|
|
1009
|
+
import { Base } from "./base";
|
|
1010
|
+
/**
|
|
1011
|
+
* Components are the building blocks of this library. Components are singleton
|
|
1012
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1013
|
+
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1014
|
+
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1015
|
+
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1016
|
+
* instance.
|
|
1017
|
+
*/
|
|
1018
|
+
export declare abstract class Component extends Base {
|
|
1019
|
+
/**
|
|
1020
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1021
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1022
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1023
|
+
* will not be updated automatically each frame.
|
|
1024
|
+
*/
|
|
1025
|
+
abstract enabled: boolean;
|
|
1026
|
+
}
|
|
1027
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1028
|
+
import { Components } from "../../Components";
|
|
1029
|
+
/**
|
|
1030
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1031
|
+
*/
|
|
1032
|
+
export declare abstract class Base {
|
|
1033
|
+
components: Components;
|
|
1034
|
+
constructor(components: Components);
|
|
1035
|
+
/** Whether is component is {@link Disposable}. */
|
|
1036
|
+
isDisposeable: () => this is Disposable;
|
|
1037
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1038
|
+
isResizeable: () => this is Resizeable;
|
|
1039
|
+
/** Whether is component is {@link Updateable}. */
|
|
1040
|
+
isUpdateable: () => this is Updateable;
|
|
1041
|
+
/** Whether is component is {@link Hideable}. */
|
|
1042
|
+
isHideable: () => this is Hideable;
|
|
1043
|
+
/** Whether is component is {@link Configurable}. */
|
|
1044
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1045
|
+
}
|
|
1046
|
+
import { Base } from "./base";
|
|
1047
|
+
import { World } from "./world";
|
|
1048
|
+
import { Event } from "./event";
|
|
1049
|
+
import { Components } from "../../Components";
|
|
1050
|
+
/**
|
|
1051
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1052
|
+
* or a renderer.
|
|
1053
|
+
*/
|
|
1054
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1055
|
+
readonly worlds: Map<string, World>;
|
|
1056
|
+
readonly onWorldChanged: Event<{
|
|
1057
|
+
world: World;
|
|
1058
|
+
action: "added" | "removed";
|
|
1059
|
+
}>;
|
|
1060
|
+
currentWorld: World | null;
|
|
1061
|
+
protected constructor(components: Components);
|
|
1062
|
+
}
|
|
1063
|
+
import * as WEBIFC from "web-ifc";
|
|
1064
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
1065
|
+
export declare class SpatialStructure {
|
|
1066
|
+
itemsByFloor: IfcItemsCategories;
|
|
1067
|
+
private _units;
|
|
1068
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1069
|
+
cleanUp(): void;
|
|
1070
|
+
}
|
|
1071
|
+
import * as THREE from "three";
|
|
1072
|
+
import CameraControls from "camera-controls";
|
|
1073
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1074
|
+
import { CameraControllable } from "./interfaces";
|
|
1075
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1076
|
+
abstract enabled: boolean;
|
|
1077
|
+
abstract three: THREE.Camera;
|
|
1078
|
+
abstract controls?: CameraControls;
|
|
1079
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1080
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1081
|
+
}
|
|
1082
|
+
import * as THREE from "three";
|
|
1083
|
+
import { Disposable } from "./interfaces";
|
|
1084
|
+
import { Event } from "./event";
|
|
1085
|
+
import { Components } from "../../Components";
|
|
1086
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1087
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1088
|
+
/** {@link Disposable.onDisposed} */
|
|
1089
|
+
readonly onDisposed: Event<unknown>;
|
|
1090
|
+
abstract three: THREE.Object3D;
|
|
1091
|
+
protected constructor(components: Components);
|
|
1092
|
+
/** {@link Disposable.dispose} */
|
|
1093
|
+
dispose(): void;
|
|
1094
|
+
}
|
|
1095
|
+
import * as THREE from "three";
|
|
1096
|
+
import { Vector2 } from "three";
|
|
1097
|
+
import { Event } from "./event";
|
|
1098
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1099
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1100
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1101
|
+
abstract three: THREE.WebGLRenderer;
|
|
1102
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1103
|
+
onAfterUpdate: Event<unknown>;
|
|
1104
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1105
|
+
onBeforeUpdate: Event<unknown>;
|
|
1106
|
+
/** {@link Disposable.onDisposed} */
|
|
1107
|
+
readonly onDisposed: Event<undefined>;
|
|
1108
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Event that fires when there has been a change to the list of clipping
|
|
1111
|
+
* planes used by the active renderer.
|
|
1112
|
+
*/
|
|
1113
|
+
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
1114
|
+
abstract update(delta?: number): void | Promise<void>;
|
|
1115
|
+
abstract dispose(): void;
|
|
1116
|
+
abstract getSize(): Vector2;
|
|
1117
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1120
|
+
* instance of the renderer.
|
|
1121
|
+
*/
|
|
1122
|
+
clippingPlanes: THREE.Plane[];
|
|
1123
|
+
/**
|
|
1124
|
+
* Forces the update of the clipping planes and all components that depend
|
|
1125
|
+
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
1126
|
+
*/
|
|
1127
|
+
updateClippingPlanes(): void;
|
|
1128
|
+
/**
|
|
1129
|
+
* Adds or removes a
|
|
1130
|
+
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
1131
|
+
* to the renderer.
|
|
1132
|
+
*/
|
|
1133
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1134
|
+
}
|
|
1135
|
+
import * as THREE from "three";
|
|
1136
|
+
import { BaseScene } from "./base-scene";
|
|
1137
|
+
import { BaseCamera } from "./base-camera";
|
|
1138
|
+
import { BaseRenderer } from "./base-renderer";
|
|
1139
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
1140
|
+
export interface World extends Disposable, Updateable {
|
|
1141
|
+
meshes: Set<THREE.Mesh>;
|
|
1142
|
+
scene: BaseScene;
|
|
1143
|
+
camera: BaseCamera;
|
|
1144
|
+
renderer: BaseRenderer | null;
|
|
1145
|
+
uuid: string;
|
|
1146
|
+
}
|
|
1147
|
+
import * as THREE from "three";
|
|
1148
|
+
import { Components } from "../../Components";
|
|
1149
|
+
import { Event, World } from "../../Types";
|
|
1150
|
+
export interface CullerRendererSettings {
|
|
1151
|
+
updateInterval?: number;
|
|
1152
|
+
width?: number;
|
|
1153
|
+
height?: number;
|
|
1154
|
+
autoUpdate?: boolean;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* A base renderer to determine visibility on screen
|
|
1158
|
+
*/
|
|
1159
|
+
export declare class CullerRenderer {
|
|
1160
|
+
/** {@link Disposable.onDisposed} */
|
|
1161
|
+
readonly onDisposed: Event<string>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1164
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1165
|
+
* just before but not anymore.
|
|
1166
|
+
*/
|
|
1167
|
+
readonly onViewUpdated: Event<any>;
|
|
1168
|
+
/** {@link Component.enabled} */
|
|
1169
|
+
enabled: boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1172
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1173
|
+
*/
|
|
1174
|
+
needsUpdate: boolean;
|
|
1175
|
+
/**
|
|
1176
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1177
|
+
* for debugging purposes.
|
|
1178
|
+
*/
|
|
1179
|
+
renderDebugFrame: boolean;
|
|
1180
|
+
components: Components;
|
|
1181
|
+
readonly world: World;
|
|
1182
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1183
|
+
protected autoUpdate: boolean;
|
|
1184
|
+
protected updateInterval: number;
|
|
1185
|
+
protected readonly worker: Worker;
|
|
1186
|
+
protected readonly scene: THREE.Scene;
|
|
1187
|
+
private _width;
|
|
1188
|
+
private _height;
|
|
1189
|
+
private _availableColor;
|
|
1190
|
+
private readonly renderTarget;
|
|
1191
|
+
private readonly bufferSize;
|
|
1192
|
+
private readonly _buffer;
|
|
1193
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1194
|
+
/** {@link Disposable.dispose} */
|
|
1195
|
+
dispose(): void;
|
|
1196
|
+
/**
|
|
1197
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1198
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1199
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1200
|
+
* not true.
|
|
1201
|
+
*/
|
|
1202
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1203
|
+
protected getAvailableColor(): {
|
|
1204
|
+
r: number;
|
|
1205
|
+
g: number;
|
|
1206
|
+
b: number;
|
|
1207
|
+
code: string;
|
|
1208
|
+
};
|
|
1209
|
+
protected increaseColor(): void;
|
|
1210
|
+
protected decreaseColor(): void;
|
|
1211
|
+
private applySettings;
|
|
1212
|
+
}
|
|
1213
|
+
import * as THREE from "three";
|
|
1214
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1215
|
+
import { Components } from "../../Components";
|
|
1216
|
+
import { Event, World } from "../../Types";
|
|
1217
|
+
/**
|
|
1218
|
+
* A renderer to determine a mesh visibility on screen
|
|
1219
|
+
*/
|
|
1220
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1221
|
+
threshold: number;
|
|
1222
|
+
readonly onViewUpdated: Event<{
|
|
1223
|
+
seen: Set<THREE.Mesh>;
|
|
1224
|
+
unseen: Set<THREE.Mesh>;
|
|
1225
|
+
}>;
|
|
1226
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1227
|
+
isProcessing: boolean;
|
|
1228
|
+
private _colorCodeMeshMap;
|
|
1229
|
+
private _meshIDColorCodeMap;
|
|
1230
|
+
private _currentVisibleMeshes;
|
|
1231
|
+
private _recentlyHiddenMeshes;
|
|
1232
|
+
private readonly _transparentMat;
|
|
1233
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1234
|
+
dispose(): void;
|
|
1235
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1236
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1237
|
+
private handleWorkerMessage;
|
|
1238
|
+
private getAvailableMaterial;
|
|
1294
1239
|
}
|
|
1240
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1241
|
+
import * as THREE from "three";
|
|
1242
|
+
import { Disposable, Event } from "../../Types";
|
|
1295
1243
|
/**
|
|
1296
|
-
*
|
|
1244
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1245
|
+
* to work with tools like the
|
|
1246
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1247
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1297
1248
|
*/
|
|
1298
|
-
export
|
|
1299
|
-
|
|
1249
|
+
export declare class Mouse implements Disposable {
|
|
1250
|
+
dom: HTMLCanvasElement;
|
|
1251
|
+
private _event?;
|
|
1252
|
+
private _position;
|
|
1253
|
+
/** {@link Disposable.onDisposed} */
|
|
1254
|
+
readonly onDisposed: Event<unknown>;
|
|
1255
|
+
constructor(dom: HTMLCanvasElement);
|
|
1256
|
+
/**
|
|
1257
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1258
|
+
*/
|
|
1259
|
+
get position(): THREE.Vector2;
|
|
1260
|
+
/** {@link Disposable.dispose} */
|
|
1261
|
+
dispose(): void;
|
|
1262
|
+
private getPositionY;
|
|
1263
|
+
private getPositionX;
|
|
1264
|
+
private updateMouseInfo;
|
|
1265
|
+
private setupEvents;
|
|
1300
1266
|
}
|
|
1301
|
-
import
|
|
1267
|
+
import * as THREE from "three";
|
|
1302
1268
|
import { Components } from "../../Components";
|
|
1269
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1270
|
+
import { Mouse } from "./mouse";
|
|
1303
1271
|
/**
|
|
1304
|
-
*
|
|
1272
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1273
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1274
|
+
* events.
|
|
1305
1275
|
*/
|
|
1306
|
-
export declare
|
|
1276
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1277
|
+
/** {@link Component.enabled} */
|
|
1278
|
+
enabled: boolean;
|
|
1307
1279
|
components: Components;
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
/**
|
|
1316
|
-
|
|
1317
|
-
/**
|
|
1318
|
-
|
|
1280
|
+
/** {@link Disposable.onDisposed} */
|
|
1281
|
+
readonly onDisposed: Event<unknown>;
|
|
1282
|
+
/** The position of the mouse in the screen. */
|
|
1283
|
+
readonly mouse: Mouse;
|
|
1284
|
+
readonly three: THREE.Raycaster;
|
|
1285
|
+
world: World;
|
|
1286
|
+
constructor(components: Components, world: World);
|
|
1287
|
+
/** {@link Disposable.dispose} */
|
|
1288
|
+
dispose(): void;
|
|
1289
|
+
/**
|
|
1290
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1291
|
+
* the first item found. This also takes into account the clipping planes
|
|
1292
|
+
* used by the renderer.
|
|
1293
|
+
*
|
|
1294
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1295
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1296
|
+
* {@link Components.meshes}.
|
|
1297
|
+
*/
|
|
1298
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1299
|
+
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;
|
|
1300
|
+
private intersect;
|
|
1301
|
+
private filterClippingPlanes;
|
|
1319
1302
|
}
|
|
1320
|
-
import
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1325
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1326
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1327
|
-
* instance.
|
|
1328
|
-
*/
|
|
1329
|
-
export declare abstract class Component extends Base {
|
|
1303
|
+
import * as THREE from "three";
|
|
1304
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1305
|
+
import { Components } from "../../Components";
|
|
1306
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1330
1307
|
/**
|
|
1331
|
-
*
|
|
1332
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1333
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1334
|
-
* will not be updated automatically each frame.
|
|
1308
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1335
1309
|
*/
|
|
1336
|
-
|
|
1310
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1311
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1312
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1313
|
+
enabled: boolean;
|
|
1314
|
+
uuid: string;
|
|
1315
|
+
readonly onDisposed: Event<unknown>;
|
|
1316
|
+
private _scene?;
|
|
1317
|
+
private _camera?;
|
|
1318
|
+
private _renderer;
|
|
1319
|
+
get scene(): T;
|
|
1320
|
+
set scene(scene: T);
|
|
1321
|
+
get camera(): U;
|
|
1322
|
+
set camera(camera: U);
|
|
1323
|
+
get renderer(): S | null;
|
|
1324
|
+
set renderer(renderer: S | null);
|
|
1325
|
+
constructor(components: Components);
|
|
1326
|
+
update(delta?: number): void;
|
|
1327
|
+
dispose(disposeResources?: boolean): void;
|
|
1337
1328
|
}
|
|
1338
|
-
import
|
|
1339
|
-
import { World } from "
|
|
1340
|
-
import { Event } from "./event";
|
|
1329
|
+
import * as THREE from "three";
|
|
1330
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1341
1331
|
import { Components } from "../../Components";
|
|
1342
1332
|
/**
|
|
1343
|
-
*
|
|
1344
|
-
* or a renderer.
|
|
1333
|
+
* Each of the planes created by {@link SimpleClipper}.
|
|
1345
1334
|
*/
|
|
1346
|
-
export declare
|
|
1347
|
-
|
|
1348
|
-
readonly
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
|
|
1335
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
1336
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1337
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
1338
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1339
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
1340
|
+
/** {@link Disposable.onDisposed} */
|
|
1341
|
+
readonly onDisposed: Event<unknown>;
|
|
1342
|
+
readonly normal: THREE.Vector3;
|
|
1343
|
+
readonly origin: THREE.Vector3;
|
|
1344
|
+
readonly three: THREE.Plane;
|
|
1345
|
+
protected readonly _helper: THREE.Object3D;
|
|
1346
|
+
protected _visible: boolean;
|
|
1347
|
+
protected _enabled: boolean;
|
|
1348
|
+
components: Components;
|
|
1349
|
+
world: World;
|
|
1350
|
+
private _controlsActive;
|
|
1351
|
+
private readonly _arrowBoundBox;
|
|
1352
|
+
private readonly _planeMesh;
|
|
1353
|
+
private readonly _controls;
|
|
1354
|
+
private readonly _hiddenMaterial;
|
|
1355
|
+
get enabled(): boolean;
|
|
1356
|
+
/** {@link Component.enabled} */
|
|
1357
|
+
set enabled(state: boolean);
|
|
1358
|
+
/** {@link Hideable.visible } */
|
|
1359
|
+
get visible(): boolean;
|
|
1360
|
+
/** {@link Hideable.visible } */
|
|
1361
|
+
set visible(state: boolean);
|
|
1362
|
+
/** The meshes used for raycasting */
|
|
1363
|
+
get meshes(): THREE.Mesh[];
|
|
1364
|
+
/** The material of the clipping plane representation. */
|
|
1365
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1366
|
+
/** The material of the clipping plane representation. */
|
|
1367
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1368
|
+
/** The size of the clipping plane representation. */
|
|
1369
|
+
get size(): number;
|
|
1370
|
+
/** Sets the size of the clipping plane representation. */
|
|
1371
|
+
set size(size: number);
|
|
1372
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1373
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1374
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1375
|
+
/** {@link Updateable.update} */
|
|
1376
|
+
update: () => Promise<void>;
|
|
1377
|
+
/** {@link Disposable.dispose} */
|
|
1378
|
+
dispose(): void;
|
|
1379
|
+
private reset;
|
|
1380
|
+
protected toggleControls(state: boolean): void;
|
|
1381
|
+
private newTransformControls;
|
|
1382
|
+
private initializeControls;
|
|
1383
|
+
private createArrowBoundingBox;
|
|
1384
|
+
private changeDrag;
|
|
1385
|
+
private notifyDraggingChanged;
|
|
1386
|
+
private preventCameraMovement;
|
|
1387
|
+
private newHelper;
|
|
1388
|
+
private static newPlaneMesh;
|
|
1354
1389
|
}
|
|
1355
1390
|
import * as THREE from "three";
|
|
1356
|
-
import
|
|
1357
|
-
import {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1391
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1392
|
+
import { Components } from "../../Components";
|
|
1393
|
+
export interface SimpleSceneConfig {
|
|
1394
|
+
directionalLight: {
|
|
1395
|
+
color: THREE.Color;
|
|
1396
|
+
intensity: number;
|
|
1397
|
+
position: THREE.Vector3;
|
|
1398
|
+
};
|
|
1399
|
+
ambientLight: {
|
|
1400
|
+
color: THREE.Color;
|
|
1401
|
+
intensity: number;
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
/**
|
|
1405
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1406
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1407
|
+
* @noInheritDoc
|
|
1408
|
+
*/
|
|
1409
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1410
|
+
/** {@link Configurable.isSetup} */
|
|
1411
|
+
isSetup: boolean;
|
|
1412
|
+
three: THREE.Scene;
|
|
1413
|
+
/** {@link Configurable.onSetup} */
|
|
1414
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1415
|
+
config: Required<SimpleSceneConfig>;
|
|
1416
|
+
constructor(components: Components);
|
|
1417
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1418
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1365
1419
|
}
|
|
1366
1420
|
import * as THREE from "three";
|
|
1367
|
-
import {
|
|
1368
|
-
import { Event } from "./event";
|
|
1421
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1369
1422
|
import { Components } from "../../Components";
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1423
|
+
/**
|
|
1424
|
+
* A basic renderer capable of rendering
|
|
1425
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1426
|
+
*/
|
|
1427
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1428
|
+
/** {@link Component.enabled} */
|
|
1429
|
+
enabled: boolean;
|
|
1430
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1431
|
+
container: HTMLElement | null;
|
|
1432
|
+
three: THREE.WebGLRenderer;
|
|
1433
|
+
protected _canvas: HTMLCanvasElement;
|
|
1434
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1435
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1436
|
+
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1437
|
+
/** {@link Updateable.update} */
|
|
1438
|
+
update(): void;
|
|
1376
1439
|
/** {@link Disposable.dispose} */
|
|
1377
1440
|
dispose(): void;
|
|
1441
|
+
/** {@link Resizeable.getSize}. */
|
|
1442
|
+
getSize(): THREE.Vector2;
|
|
1443
|
+
/** {@link Resizeable.resize} */
|
|
1444
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1445
|
+
setupEvents(active: boolean): void;
|
|
1446
|
+
private resizeEvent;
|
|
1447
|
+
private setupRenderer;
|
|
1448
|
+
private onContextLost;
|
|
1449
|
+
private onContextBack;
|
|
1450
|
+
private updateContainer;
|
|
1378
1451
|
}
|
|
1379
1452
|
import * as THREE from "three";
|
|
1380
|
-
import
|
|
1381
|
-
import { Event } from "
|
|
1382
|
-
import {
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1453
|
+
import CameraControls from "camera-controls";
|
|
1454
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1455
|
+
import { Components } from "../../Components";
|
|
1456
|
+
/**
|
|
1457
|
+
* A basic camera that uses
|
|
1458
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1459
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1460
|
+
* what features it offers.
|
|
1461
|
+
*/
|
|
1462
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1386
1463
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1387
|
-
|
|
1464
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1388
1465
|
/** {@link Updateable.onAfterUpdate} */
|
|
1389
|
-
|
|
1466
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1467
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1390
1468
|
/** {@link Disposable.onDisposed} */
|
|
1391
|
-
readonly onDisposed: Event<
|
|
1392
|
-
readonly
|
|
1393
|
-
|
|
1394
|
-
* Event that fires when there has been a change to the list of clipping
|
|
1395
|
-
* planes used by the active renderer.
|
|
1396
|
-
*/
|
|
1397
|
-
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
1398
|
-
abstract update(delta?: number): void | Promise<void>;
|
|
1399
|
-
abstract dispose(): void;
|
|
1400
|
-
abstract getSize(): Vector2;
|
|
1401
|
-
abstract resize(size: Vector2 | undefined): void;
|
|
1402
|
-
/**
|
|
1403
|
-
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1404
|
-
* instance of the renderer.
|
|
1405
|
-
*/
|
|
1406
|
-
clippingPlanes: THREE.Plane[];
|
|
1469
|
+
readonly onDisposed: Event<string>;
|
|
1470
|
+
readonly three: THREE.PerspectiveCamera;
|
|
1471
|
+
private _allControls;
|
|
1407
1472
|
/**
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1473
|
+
* The object that controls the camera. An instance of
|
|
1474
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1475
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1476
|
+
* object to move, rotate, look at objects, etc.
|
|
1410
1477
|
*/
|
|
1411
|
-
|
|
1478
|
+
get controls(): CameraControls;
|
|
1479
|
+
/** {@link Component.enabled} */
|
|
1480
|
+
get enabled(): boolean;
|
|
1481
|
+
/** {@link Component.enabled} */
|
|
1482
|
+
set enabled(enabled: boolean);
|
|
1483
|
+
constructor(components: Components);
|
|
1484
|
+
/** {@link Disposable.dispose} */
|
|
1485
|
+
dispose(): void;
|
|
1486
|
+
/** {@link Updateable.update} */
|
|
1487
|
+
update(_delta: number): void;
|
|
1412
1488
|
/**
|
|
1413
|
-
*
|
|
1414
|
-
*
|
|
1415
|
-
* to the renderer.
|
|
1489
|
+
* Updates the aspect of the camera to match the size of the
|
|
1490
|
+
* {@link Components.renderer}.
|
|
1416
1491
|
*/
|
|
1417
|
-
|
|
1492
|
+
updateAspect: () => void;
|
|
1493
|
+
private setupCamera;
|
|
1494
|
+
private newCameraControls;
|
|
1495
|
+
private setupEvents;
|
|
1496
|
+
private static getSubsetOfThree;
|
|
1418
1497
|
}
|
|
1419
|
-
import
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
renderer: BaseRenderer | null;
|
|
1429
|
-
uuid: string;
|
|
1498
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1499
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1500
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1501
|
+
minGeometrySize: number;
|
|
1502
|
+
minAssetsSize: number;
|
|
1503
|
+
}
|
|
1504
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1505
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1506
|
+
propertiesSize: number;
|
|
1430
1507
|
}
|
|
1431
1508
|
/// <reference types="node" />
|
|
1432
1509
|
import * as THREE from "three";
|
|
@@ -1477,6 +1554,205 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
1477
1554
|
private updateZoom;
|
|
1478
1555
|
}
|
|
1479
1556
|
import * as WEBIFC from "web-ifc";
|
|
1557
|
+
import { Component, Disposable, Event } from "../../../core";
|
|
1558
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1559
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1560
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1561
|
+
onPropertiesStreamed: Event<{
|
|
1562
|
+
type: number;
|
|
1563
|
+
data: {
|
|
1564
|
+
[id: number]: any;
|
|
1565
|
+
};
|
|
1566
|
+
}>;
|
|
1567
|
+
onProgress: Event<number>;
|
|
1568
|
+
onIndicesStreamed: Event<number[][]>;
|
|
1569
|
+
/** {@link Disposable.onDisposed} */
|
|
1570
|
+
readonly onDisposed: Event<string>;
|
|
1571
|
+
enabled: boolean;
|
|
1572
|
+
settings: PropertiesStreamingSettings;
|
|
1573
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1574
|
+
dispose(): Promise<void>;
|
|
1575
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1576
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1577
|
+
private readIfcFile;
|
|
1578
|
+
private streamIfcFile;
|
|
1579
|
+
private streamAllProperties;
|
|
1580
|
+
private getIndices;
|
|
1581
|
+
private cleanUp;
|
|
1582
|
+
}
|
|
1583
|
+
export interface StreamedGeometries {
|
|
1584
|
+
[id: number]: {
|
|
1585
|
+
boundingBox: Float32Array;
|
|
1586
|
+
hasHoles: boolean;
|
|
1587
|
+
geometryFile?: string;
|
|
1588
|
+
};
|
|
1589
|
+
}
|
|
1590
|
+
export interface StreamedAsset {
|
|
1591
|
+
id: number;
|
|
1592
|
+
geometries: {
|
|
1593
|
+
geometryID: number;
|
|
1594
|
+
transformation: number[];
|
|
1595
|
+
color: number[];
|
|
1596
|
+
}[];
|
|
1597
|
+
}
|
|
1598
|
+
import * as WEBIFC from "web-ifc";
|
|
1599
|
+
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1600
|
+
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1601
|
+
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1602
|
+
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1603
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1604
|
+
onGeometryStreamed: Event<{
|
|
1605
|
+
buffer: Uint8Array;
|
|
1606
|
+
data: StreamedGeometries;
|
|
1607
|
+
}>;
|
|
1608
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1609
|
+
onProgress: Event<number>;
|
|
1610
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
1611
|
+
/** {@link Disposable.onDisposed} */
|
|
1612
|
+
readonly onDisposed: Event<unknown>;
|
|
1613
|
+
settings: IfcStreamingSettings;
|
|
1614
|
+
enabled: boolean;
|
|
1615
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1616
|
+
private _spatialTree;
|
|
1617
|
+
private _metaData;
|
|
1618
|
+
private _visitedGeometries;
|
|
1619
|
+
private _streamSerializer;
|
|
1620
|
+
private _geometries;
|
|
1621
|
+
private _geometryCount;
|
|
1622
|
+
private _civil;
|
|
1623
|
+
private _groupSerializer;
|
|
1624
|
+
private _assets;
|
|
1625
|
+
private _meshesWithHoles;
|
|
1626
|
+
constructor(components: Components);
|
|
1627
|
+
dispose(): void;
|
|
1628
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1629
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1630
|
+
private readIfcFile;
|
|
1631
|
+
private streamIfcFile;
|
|
1632
|
+
private streamAllGeometries;
|
|
1633
|
+
private cleanUp;
|
|
1634
|
+
private getMesh;
|
|
1635
|
+
private getGeometry;
|
|
1636
|
+
private streamAssets;
|
|
1637
|
+
private streamGeometries;
|
|
1638
|
+
}
|
|
1639
|
+
import { NavigationMode } from "./types";
|
|
1640
|
+
/**
|
|
1641
|
+
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1642
|
+
* like in many 3D and CAD softwares.
|
|
1643
|
+
*/
|
|
1644
|
+
export declare class OrbitMode implements NavigationMode {
|
|
1645
|
+
camera: any;
|
|
1646
|
+
/** {@link NavigationMode.enabled} */
|
|
1647
|
+
enabled: boolean;
|
|
1648
|
+
/** {@link NavigationMode.id} */
|
|
1649
|
+
readonly id = "Orbit";
|
|
1650
|
+
constructor(camera: any);
|
|
1651
|
+
/** {@link NavigationMode.set} */
|
|
1652
|
+
set(active: boolean): void;
|
|
1653
|
+
private activateOrbitControls;
|
|
1654
|
+
}
|
|
1655
|
+
import { NavigationMode } from "./types";
|
|
1656
|
+
/**
|
|
1657
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1658
|
+
* simulating FPS video games.
|
|
1659
|
+
*/
|
|
1660
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1661
|
+
private camera;
|
|
1662
|
+
/** {@link NavigationMode.enabled} */
|
|
1663
|
+
enabled: boolean;
|
|
1664
|
+
/** {@link NavigationMode.id} */
|
|
1665
|
+
readonly id = "FirstPerson";
|
|
1666
|
+
constructor(camera: any);
|
|
1667
|
+
/** {@link NavigationMode.set} */
|
|
1668
|
+
set(active: boolean): void;
|
|
1669
|
+
private setupFirstPersonCamera;
|
|
1670
|
+
}
|
|
1671
|
+
import * as THREE from "three";
|
|
1672
|
+
import { CameraProjection } from "./types";
|
|
1673
|
+
import { Event } from "../../../core";
|
|
1674
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1675
|
+
/**
|
|
1676
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1677
|
+
*/
|
|
1678
|
+
export declare class ProjectionManager {
|
|
1679
|
+
/**
|
|
1680
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
1681
|
+
*/
|
|
1682
|
+
readonly onChanged: Event<THREE.Camera>;
|
|
1683
|
+
current: CameraProjection;
|
|
1684
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1685
|
+
private _component;
|
|
1686
|
+
private _previousDistance;
|
|
1687
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1688
|
+
matchOrthoDistanceEnabled: boolean;
|
|
1689
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1690
|
+
/**
|
|
1691
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1692
|
+
*
|
|
1693
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
1694
|
+
* it will have no effect.
|
|
1695
|
+
*/
|
|
1696
|
+
set(projection: CameraProjection): Promise<void>;
|
|
1697
|
+
/**
|
|
1698
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1699
|
+
* and vice versa.
|
|
1700
|
+
*/
|
|
1701
|
+
toggle(): Promise<void>;
|
|
1702
|
+
private setOrthoCamera;
|
|
1703
|
+
private getDims;
|
|
1704
|
+
private setupOrthoCamera;
|
|
1705
|
+
private getDistance;
|
|
1706
|
+
private setPerspectiveCamera;
|
|
1707
|
+
}
|
|
1708
|
+
import { NavigationMode } from "./types";
|
|
1709
|
+
/**
|
|
1710
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1711
|
+
* like many BIM tools.
|
|
1712
|
+
*/
|
|
1713
|
+
export declare class PlanMode implements NavigationMode {
|
|
1714
|
+
private camera;
|
|
1715
|
+
/** {@link NavigationMode.enabled} */
|
|
1716
|
+
enabled: boolean;
|
|
1717
|
+
/** {@link NavigationMode.id} */
|
|
1718
|
+
readonly id = "Plan";
|
|
1719
|
+
private mouseAction1?;
|
|
1720
|
+
private mouseAction2?;
|
|
1721
|
+
private mouseInitialized;
|
|
1722
|
+
private readonly defaultAzimuthSpeed;
|
|
1723
|
+
private readonly defaultPolarSpeed;
|
|
1724
|
+
constructor(camera: any);
|
|
1725
|
+
/** {@link NavigationMode.set} */
|
|
1726
|
+
set(active: boolean): void;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* The projection system of the camera.
|
|
1730
|
+
*/
|
|
1731
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1732
|
+
/**
|
|
1733
|
+
* The extensible list of supported navigation modes.
|
|
1734
|
+
*/
|
|
1735
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1736
|
+
/**
|
|
1737
|
+
* An object that determines the behavior of the camera controls
|
|
1738
|
+
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1739
|
+
*/
|
|
1740
|
+
export interface NavigationMode {
|
|
1741
|
+
/** The unique ID of this navigation mode. */
|
|
1742
|
+
id: NavModeID;
|
|
1743
|
+
/**
|
|
1744
|
+
* Enable or disable this navigation mode.
|
|
1745
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
1746
|
+
* must be disabled.
|
|
1747
|
+
*
|
|
1748
|
+
* @param active - whether to enable or disable this mode.
|
|
1749
|
+
* @param options - any additional data required to enable or disable it.
|
|
1750
|
+
* */
|
|
1751
|
+
set: (active: boolean, options?: any) => void;
|
|
1752
|
+
/** Whether this navigation mode is active or not. */
|
|
1753
|
+
enabled: boolean;
|
|
1754
|
+
}
|
|
1755
|
+
import * as WEBIFC from "web-ifc";
|
|
1480
1756
|
import * as THREE from "three";
|
|
1481
1757
|
export declare class Units {
|
|
1482
1758
|
factor: number;
|
|
@@ -1537,21 +1813,6 @@ import * as THREE from "three";
|
|
|
1537
1813
|
export declare class TransformHelper {
|
|
1538
1814
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1539
1815
|
}
|
|
1540
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1541
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
1542
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1543
|
-
enabled: boolean;
|
|
1544
|
-
height: number;
|
|
1545
|
-
groupName: string;
|
|
1546
|
-
/** {@link Disposable.onDisposed} */
|
|
1547
|
-
readonly onDisposed: Event<string>;
|
|
1548
|
-
list: Set<string>;
|
|
1549
|
-
constructor(components: Components);
|
|
1550
|
-
dispose(): void;
|
|
1551
|
-
explode(): void;
|
|
1552
|
-
reset(): void;
|
|
1553
|
-
update(): void;
|
|
1554
|
-
}
|
|
1555
1816
|
export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
|
|
1556
1817
|
export type ConditionFunctions = {
|
|
1557
1818
|
[queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
|
|
@@ -1575,5 +1836,54 @@ export interface Query {
|
|
|
1575
1836
|
description?: string;
|
|
1576
1837
|
groups: QueryGroup;
|
|
1577
1838
|
}
|
|
1839
|
+
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
1840
|
+
import { MiniMap } from "./src";
|
|
1841
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
1842
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
1843
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1844
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1845
|
+
readonly onDisposed: Event<unknown>;
|
|
1846
|
+
enabled: boolean;
|
|
1847
|
+
list: Map<string, MiniMap>;
|
|
1848
|
+
constructor(components: Components);
|
|
1849
|
+
create(world: World): MiniMap;
|
|
1850
|
+
delete(id: string): void;
|
|
1851
|
+
dispose(): void | Promise<void>;
|
|
1852
|
+
update(): void;
|
|
1853
|
+
}
|
|
1854
|
+
import * as THREE from "three";
|
|
1855
|
+
import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
|
|
1856
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
1857
|
+
/** {@link Disposable.onDisposed} */
|
|
1858
|
+
readonly onDisposed: Event<unknown>;
|
|
1859
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1860
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1861
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1862
|
+
frontOffset: number;
|
|
1863
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
1864
|
+
backgroundColor: THREE.Color;
|
|
1865
|
+
renderer: THREE.WebGLRenderer;
|
|
1866
|
+
enabled: boolean;
|
|
1867
|
+
world: World;
|
|
1868
|
+
private _lockRotation;
|
|
1869
|
+
private _camera;
|
|
1870
|
+
private _plane;
|
|
1871
|
+
private _size;
|
|
1872
|
+
private _tempVector1;
|
|
1873
|
+
private _tempVector2;
|
|
1874
|
+
private _tempTarget;
|
|
1875
|
+
private readonly down;
|
|
1876
|
+
get lockRotation(): boolean;
|
|
1877
|
+
set lockRotation(active: boolean);
|
|
1878
|
+
get zoom(): number;
|
|
1879
|
+
set zoom(value: number);
|
|
1880
|
+
constructor(world: World);
|
|
1881
|
+
dispose(): void;
|
|
1882
|
+
get(): THREE.OrthographicCamera;
|
|
1883
|
+
update(): void;
|
|
1884
|
+
getSize(): THREE.Vector2;
|
|
1885
|
+
resize(size?: THREE.Vector2): void;
|
|
1886
|
+
private updatePlanes;
|
|
1887
|
+
}
|
|
1578
1888
|
|
|
1579
1889
|
}
|