@thatopen/components 2.0.0-alpha.0 → 2.0.0-alpha.2
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/fragments/FragmentIfcLoader/index.d.ts +0 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -4
- package/dist/namespace.d.ts +853 -854
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -300,24 +300,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
300
300
|
*/
|
|
301
301
|
removeMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
302
302
|
}
|
|
303
|
-
import * as THREE from "three";
|
|
304
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
305
|
-
center: THREE.Vector3;
|
|
306
|
-
halfSizes: THREE.Vector3;
|
|
307
|
-
rotation: THREE.Matrix3;
|
|
308
|
-
transformation: THREE.Matrix4;
|
|
309
|
-
};
|
|
310
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
311
|
-
import * as THREE from "three";
|
|
312
|
-
export declare class MaterialsUtils {
|
|
313
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
314
|
-
}
|
|
315
|
-
export declare class UUID {
|
|
316
|
-
private static _pattern;
|
|
317
|
-
private static _lut;
|
|
318
|
-
static create(): string;
|
|
319
|
-
static validate(uuid: string): void;
|
|
320
|
-
}
|
|
321
303
|
import { Components } from "../Components";
|
|
322
304
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
323
305
|
import { Component, Event, Disposable, World } from "../Types";
|
|
@@ -340,6 +322,90 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
340
322
|
/** {@link Disposable.dispose} */
|
|
341
323
|
dispose(): void;
|
|
342
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
|
+
}
|
|
343
409
|
import * as THREE from "three";
|
|
344
410
|
import * as FRAGS from "bim-fragment";
|
|
345
411
|
import { FragmentsGroup } from "bim-fragment";
|
|
@@ -407,38 +473,78 @@ export declare class FragmentClassifier extends Component implements Disposable
|
|
|
407
473
|
private saveItem;
|
|
408
474
|
}
|
|
409
475
|
import * as WEBIFC from "web-ifc";
|
|
410
|
-
import
|
|
411
|
-
import {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
476
|
+
import { FragmentsGroup } from "bim-fragment";
|
|
477
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
478
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
479
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
480
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
481
|
+
interface ChangeMap {
|
|
482
|
+
[modelID: string]: Set<number>;
|
|
483
|
+
}
|
|
484
|
+
interface AttributeListener {
|
|
485
|
+
[modelID: string]: {
|
|
486
|
+
[expressID: number]: {
|
|
487
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
492
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
418
493
|
/** {@link Disposable.onDisposed} */
|
|
419
494
|
readonly onDisposed: Event<string>;
|
|
420
|
-
|
|
495
|
+
readonly onRequestFile: Event<unknown>;
|
|
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
|
+
};
|
|
421
519
|
enabled: boolean;
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
private
|
|
425
|
-
private _metaData;
|
|
426
|
-
private _fragmentInstances;
|
|
427
|
-
private _civil;
|
|
428
|
-
private _propertyExporter;
|
|
429
|
-
private _visitedFragments;
|
|
430
|
-
private _materialT;
|
|
520
|
+
attributeListeners: AttributeListener;
|
|
521
|
+
selectedModel?: FragmentsGroup;
|
|
522
|
+
private _changeMap;
|
|
431
523
|
constructor(components: Components);
|
|
524
|
+
get(): ChangeMap;
|
|
432
525
|
dispose(): void;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
private
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
526
|
+
private increaseMaxID;
|
|
527
|
+
static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
|
|
528
|
+
private newGUID;
|
|
529
|
+
private getOwnerHistory;
|
|
530
|
+
private registerChange;
|
|
531
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
532
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
533
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
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>>;
|
|
441
546
|
}
|
|
547
|
+
export {};
|
|
442
548
|
import { Fragment, FragmentsGroup } from "bim-fragment";
|
|
443
549
|
import * as THREE from "three";
|
|
444
550
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
@@ -484,163 +590,58 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
484
590
|
coordinate(models?: FragmentsGroup[]): void;
|
|
485
591
|
}
|
|
486
592
|
import * as WEBIFC from "web-ifc";
|
|
487
|
-
import * as FRAG from "bim-fragment";
|
|
488
|
-
/**
|
|
489
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
490
|
-
*/
|
|
491
|
-
export declare class IfcJsonExporter {
|
|
492
|
-
/**
|
|
493
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
494
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
495
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
496
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
497
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
498
|
-
* to make the location data available (e.g. absolute position of building).
|
|
499
|
-
*/
|
|
500
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
501
|
-
}
|
|
502
593
|
import * as FRAGS from "bim-fragment";
|
|
503
|
-
import {
|
|
504
|
-
import {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
otherEntities: Set<number>;
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
export interface IndexedModels {
|
|
513
|
-
[modelID: string]: {
|
|
514
|
-
[expressID: number]: Set<number>;
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
518
|
-
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
594
|
+
import { IfcFragmentSettings } from "./src";
|
|
595
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
596
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
597
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
598
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
599
|
+
readonly onSetup: Event<void>;
|
|
519
600
|
/** {@link Disposable.onDisposed} */
|
|
520
|
-
readonly onDisposed: Event<
|
|
601
|
+
readonly onDisposed: Event<string>;
|
|
602
|
+
settings: IfcFragmentSettings;
|
|
521
603
|
enabled: boolean;
|
|
522
|
-
|
|
523
|
-
private
|
|
524
|
-
private
|
|
604
|
+
webIfc: WEBIFC.IfcAPI;
|
|
605
|
+
private _material;
|
|
606
|
+
private _spatialTree;
|
|
607
|
+
private _metaData;
|
|
608
|
+
private _fragmentInstances;
|
|
609
|
+
private _civil;
|
|
610
|
+
private _propertyExporter;
|
|
611
|
+
private _visitedFragments;
|
|
612
|
+
private _materialT;
|
|
525
613
|
constructor(components: Components);
|
|
526
|
-
private onFragmentsDisposed;
|
|
527
614
|
dispose(): void;
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
private
|
|
532
|
-
|
|
533
|
-
private
|
|
534
|
-
private
|
|
535
|
-
private
|
|
536
|
-
private arrayUnion;
|
|
537
|
-
private getConditionFunctions;
|
|
538
|
-
}
|
|
539
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
540
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
541
|
-
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
542
|
-
interface IndexMap {
|
|
543
|
-
[modelID: string]: {
|
|
544
|
-
[expressID: string]: Set<number>;
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
548
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
549
|
-
/** {@link Disposable.onDisposed} */
|
|
550
|
-
readonly onDisposed: Event<string>;
|
|
551
|
-
enabled: boolean;
|
|
552
|
-
relationsToProcess: number[];
|
|
553
|
-
indexMap: IndexMap;
|
|
554
|
-
private _propertiesManager;
|
|
555
|
-
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
556
|
-
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
557
|
-
get propertiesManager(): IfcPropertiesManager | null;
|
|
558
|
-
constructor(components: Components);
|
|
559
|
-
private onFragmentsDisposed;
|
|
560
|
-
dispose(): Promise<void>;
|
|
561
|
-
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
562
|
-
private getNestedPsets;
|
|
563
|
-
private getPsetProperties;
|
|
564
|
-
process(model: FragmentsGroup): Promise<void>;
|
|
565
|
-
private setEntityIndex;
|
|
566
|
-
private cloneProperty;
|
|
567
|
-
private clonePropertyArray;
|
|
568
|
-
}
|
|
569
|
-
export {};
|
|
570
|
-
import * as WEBIFC from "web-ifc";
|
|
571
|
-
import { FragmentsGroup } from "bim-fragment";
|
|
572
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
573
|
-
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
574
|
-
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
575
|
-
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
576
|
-
interface ChangeMap {
|
|
577
|
-
[modelID: string]: Set<number>;
|
|
615
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
616
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
617
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
618
|
+
private getAllGeometries;
|
|
619
|
+
cleanUp(): void;
|
|
620
|
+
private getMesh;
|
|
621
|
+
private getGeometry;
|
|
622
|
+
private autoSetWasm;
|
|
578
623
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
624
|
+
import * as THREE from "three";
|
|
625
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
626
|
+
center: THREE.Vector3;
|
|
627
|
+
halfSizes: THREE.Vector3;
|
|
628
|
+
rotation: THREE.Matrix3;
|
|
629
|
+
transformation: THREE.Matrix4;
|
|
630
|
+
};
|
|
631
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
632
|
+
import * as THREE from "three";
|
|
633
|
+
export declare class MaterialsUtils {
|
|
634
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
585
635
|
}
|
|
586
|
-
export declare class
|
|
587
|
-
static
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
ifcToExport: ArrayBuffer | null;
|
|
592
|
-
readonly onElementToPset: Event<{
|
|
593
|
-
model: FragmentsGroup;
|
|
594
|
-
psetID: number;
|
|
595
|
-
elementID: number;
|
|
596
|
-
}>;
|
|
597
|
-
readonly onPropToPset: Event<{
|
|
598
|
-
model: FragmentsGroup;
|
|
599
|
-
psetID: number;
|
|
600
|
-
propID: number;
|
|
601
|
-
}>;
|
|
602
|
-
readonly onPsetRemoved: Event<{
|
|
603
|
-
model: FragmentsGroup;
|
|
604
|
-
psetID: number;
|
|
605
|
-
}>;
|
|
606
|
-
readonly onDataChanged: Event<{
|
|
607
|
-
model: FragmentsGroup;
|
|
608
|
-
expressID: number;
|
|
609
|
-
}>;
|
|
610
|
-
wasm: {
|
|
611
|
-
path: string;
|
|
612
|
-
absolute: boolean;
|
|
613
|
-
};
|
|
614
|
-
enabled: boolean;
|
|
615
|
-
attributeListeners: AttributeListener;
|
|
616
|
-
selectedModel?: FragmentsGroup;
|
|
617
|
-
private _changeMap;
|
|
618
|
-
constructor(components: Components);
|
|
619
|
-
get(): ChangeMap;
|
|
620
|
-
dispose(): void;
|
|
621
|
-
private increaseMaxID;
|
|
622
|
-
static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema;
|
|
623
|
-
private newGUID;
|
|
624
|
-
private getOwnerHistory;
|
|
625
|
-
private registerChange;
|
|
626
|
-
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
627
|
-
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
628
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
629
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
630
|
-
}>;
|
|
631
|
-
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
632
|
-
private newSingleProperty;
|
|
633
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
634
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
635
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
636
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
637
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
638
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
639
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
640
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
636
|
+
export declare class UUID {
|
|
637
|
+
private static _pattern;
|
|
638
|
+
private static _lut;
|
|
639
|
+
static create(): string;
|
|
640
|
+
static validate(uuid: string): void;
|
|
641
641
|
}
|
|
642
|
-
export {
|
|
643
|
-
|
|
642
|
+
export declare const IfcElements: {
|
|
643
|
+
[key: number]: string;
|
|
644
|
+
};
|
|
644
645
|
import * as WEBIFC from "web-ifc";
|
|
645
646
|
export interface IfcItemsCategories {
|
|
646
647
|
[itemID: number]: number;
|
|
@@ -648,20 +649,9 @@ export interface IfcItemsCategories {
|
|
|
648
649
|
export declare class IfcCategories {
|
|
649
650
|
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
650
651
|
}
|
|
651
|
-
export declare const IfcElements: {
|
|
652
|
-
[key: number]: string;
|
|
653
|
-
};
|
|
654
652
|
export declare const IfcCategoryMap: {
|
|
655
653
|
[key: number]: string;
|
|
656
654
|
};
|
|
657
|
-
import * as WEBIFC from "web-ifc";
|
|
658
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
659
|
-
export declare class SpatialStructure {
|
|
660
|
-
itemsByFloor: IfcItemsCategories;
|
|
661
|
-
private _units;
|
|
662
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
663
|
-
cleanUp(): void;
|
|
664
|
-
}
|
|
665
655
|
import * as FRAGS from "bim-fragment";
|
|
666
656
|
export declare class IfcPropertiesUtils {
|
|
667
657
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -687,70 +677,523 @@ export declare class IfcPropertiesUtils {
|
|
|
687
677
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
688
678
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
689
679
|
}
|
|
680
|
+
import * as THREE from "three";
|
|
681
|
+
import { Disposable, Event } from "../../Types";
|
|
690
682
|
/**
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
* an object.
|
|
696
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
697
|
-
* the callback as an arrow function.
|
|
683
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
684
|
+
* to work with tools like the
|
|
685
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
686
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
698
687
|
*/
|
|
699
|
-
export declare class
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
} : {
|
|
707
|
-
(data: T): void;
|
|
708
|
-
}): void;
|
|
688
|
+
export declare class Mouse implements Disposable {
|
|
689
|
+
dom: HTMLCanvasElement;
|
|
690
|
+
private _event?;
|
|
691
|
+
private _position;
|
|
692
|
+
/** {@link Disposable.onDisposed} */
|
|
693
|
+
readonly onDisposed: Event<unknown>;
|
|
694
|
+
constructor(dom: HTMLCanvasElement);
|
|
709
695
|
/**
|
|
710
|
-
*
|
|
711
|
-
* @param handler - the callback to be removed from this event.
|
|
696
|
+
* The real position of the mouse of the Three.js canvas.
|
|
712
697
|
*/
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
/** Gets rid of all the suscribed events. */
|
|
721
|
-
reset(): void;
|
|
722
|
-
private handlers;
|
|
698
|
+
get position(): THREE.Vector2;
|
|
699
|
+
/** {@link Disposable.dispose} */
|
|
700
|
+
dispose(): void;
|
|
701
|
+
private getPositionY;
|
|
702
|
+
private getPositionX;
|
|
703
|
+
private updateMouseInfo;
|
|
704
|
+
private setupEvents;
|
|
723
705
|
}
|
|
724
706
|
import * as THREE from "three";
|
|
725
|
-
import
|
|
726
|
-
import { Event } from "
|
|
707
|
+
import { Components } from "../../Components";
|
|
708
|
+
import { Event, World, Disposable } from "../../Types";
|
|
709
|
+
import { Mouse } from "./mouse";
|
|
727
710
|
/**
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
* This also ensures that the DOM events created by that component will be
|
|
732
|
-
* cleaned up.
|
|
711
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
712
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
713
|
+
* events.
|
|
733
714
|
*/
|
|
734
|
-
export
|
|
715
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
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;
|
|
735
728
|
/**
|
|
736
|
-
*
|
|
737
|
-
*
|
|
729
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
730
|
+
* the first item found. This also takes into account the clipping planes
|
|
731
|
+
* used by the renderer.
|
|
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}.
|
|
738
736
|
*/
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
737
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
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;
|
|
742
750
|
}
|
|
751
|
+
import * as THREE from "three";
|
|
752
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
753
|
+
import { Components } from "../../Components";
|
|
743
754
|
/**
|
|
744
|
-
*
|
|
745
|
-
* hidden or shown in the
|
|
746
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
755
|
+
* Each of the planes created by {@link SimpleClipper}.
|
|
747
756
|
*/
|
|
748
|
-
export
|
|
749
|
-
/**
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
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
|
+
*/
|
|
754
1197
|
visible: boolean;
|
|
755
1198
|
}
|
|
756
1199
|
/**
|
|
@@ -830,451 +1273,161 @@ export interface Createable {
|
|
|
830
1273
|
/**
|
|
831
1274
|
* Whether this component supports to be configured.
|
|
832
1275
|
*/
|
|
833
|
-
export interface Configurable<T extends Record<string, any>> {
|
|
834
|
-
/** Wether this components has been already configured. */
|
|
835
|
-
isSetup: boolean;
|
|
836
|
-
/** Use the provided configuration to setup the tool. */
|
|
837
|
-
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
838
|
-
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
839
|
-
readonly onSetup: Event<any>;
|
|
840
|
-
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
841
|
-
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
842
|
-
*/
|
|
843
|
-
config: Required<T>;
|
|
844
|
-
}
|
|
845
|
-
/**
|
|
846
|
-
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
847
|
-
*/
|
|
848
|
-
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
849
|
-
boundsTree: Object | undefined;
|
|
850
|
-
disposeBoundsTree: () => void;
|
|
851
|
-
}
|
|
852
|
-
/**
|
|
853
|
-
* Whether a camera uses the Camera Controls library.
|
|
854
|
-
*/
|
|
855
|
-
export interface CameraControllable {
|
|
856
|
-
controls: CameraControls;
|
|
857
|
-
}
|
|
858
|
-
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
859
|
-
import { Components } from "../../Components";
|
|
860
|
-
/**
|
|
861
|
-
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
862
|
-
*/
|
|
863
|
-
export declare abstract class Base {
|
|
864
|
-
components: Components;
|
|
865
|
-
constructor(components: Components);
|
|
866
|
-
/** Whether is component is {@link Disposable}. */
|
|
867
|
-
isDisposeable: () => this is Disposable;
|
|
868
|
-
/** Whether is component is {@link Resizeable}. */
|
|
869
|
-
isResizeable: () => this is Resizeable;
|
|
870
|
-
/** Whether is component is {@link Updateable}. */
|
|
871
|
-
isUpdateable: () => this is Updateable;
|
|
872
|
-
/** Whether is component is {@link Hideable}. */
|
|
873
|
-
isHideable: () => this is Hideable;
|
|
874
|
-
/** Whether is component is {@link Configurable}. */
|
|
875
|
-
isConfigurable: () => this is Configurable<any>;
|
|
876
|
-
}
|
|
877
|
-
import { Base } from "./base";
|
|
878
|
-
/**
|
|
879
|
-
* Components are the building blocks of this library. Components are singleton
|
|
880
|
-
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
881
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
882
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
883
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
884
|
-
* instance.
|
|
885
|
-
*/
|
|
886
|
-
export declare abstract class Component extends Base {
|
|
887
|
-
/**
|
|
888
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
889
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
890
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
891
|
-
* will not be updated automatically each frame.
|
|
892
|
-
*/
|
|
893
|
-
abstract enabled: boolean;
|
|
894
|
-
}
|
|
895
|
-
import { Base } from "./base";
|
|
896
|
-
import { World } from "./world";
|
|
897
|
-
import { Event } from "./event";
|
|
898
|
-
import { Components } from "../../Components";
|
|
899
|
-
/**
|
|
900
|
-
* One of the elements that make a world. It can be either a scene, a camera
|
|
901
|
-
* or a renderer.
|
|
902
|
-
*/
|
|
903
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
904
|
-
readonly worlds: Map<string, World>;
|
|
905
|
-
readonly onWorldChanged: Event<{
|
|
906
|
-
world: World;
|
|
907
|
-
action: "added" | "removed";
|
|
908
|
-
}>;
|
|
909
|
-
currentWorld: World | null;
|
|
910
|
-
protected constructor(components: Components);
|
|
911
|
-
}
|
|
912
|
-
import * as THREE from "three";
|
|
913
|
-
import CameraControls from "camera-controls";
|
|
914
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
915
|
-
import { CameraControllable } from "./interfaces";
|
|
916
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
917
|
-
abstract enabled: boolean;
|
|
918
|
-
abstract three: THREE.Camera;
|
|
919
|
-
abstract controls?: CameraControls;
|
|
920
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
921
|
-
hasCameraControls: () => this is CameraControllable;
|
|
922
|
-
}
|
|
923
|
-
import * as THREE from "three";
|
|
924
|
-
import { Vector2 } from "three";
|
|
925
|
-
import { Event } from "./event";
|
|
926
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
927
|
-
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
928
|
-
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
929
|
-
abstract three: THREE.WebGLRenderer;
|
|
930
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
931
|
-
onAfterUpdate: Event<unknown>;
|
|
932
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
933
|
-
onBeforeUpdate: Event<unknown>;
|
|
934
|
-
/** {@link Disposable.onDisposed} */
|
|
935
|
-
readonly onDisposed: Event<undefined>;
|
|
936
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
937
|
-
/**
|
|
938
|
-
* Event that fires when there has been a change to the list of clipping
|
|
939
|
-
* planes used by the active renderer.
|
|
940
|
-
*/
|
|
941
|
-
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
942
|
-
abstract update(delta?: number): void | Promise<void>;
|
|
943
|
-
abstract dispose(): void;
|
|
944
|
-
abstract getSize(): Vector2;
|
|
945
|
-
abstract resize(size: Vector2 | undefined): void;
|
|
946
|
-
/**
|
|
947
|
-
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
948
|
-
* instance of the renderer.
|
|
949
|
-
*/
|
|
950
|
-
clippingPlanes: THREE.Plane[];
|
|
951
|
-
/**
|
|
952
|
-
* Forces the update of the clipping planes and all components that depend
|
|
953
|
-
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
954
|
-
*/
|
|
955
|
-
updateClippingPlanes(): void;
|
|
956
|
-
/**
|
|
957
|
-
* Adds or removes a
|
|
958
|
-
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
959
|
-
* to the renderer.
|
|
960
|
-
*/
|
|
961
|
-
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
962
|
-
}
|
|
963
|
-
import * as THREE from "three";
|
|
964
|
-
import { Disposable } from "./interfaces";
|
|
965
|
-
import { Event } from "./event";
|
|
966
|
-
import { Components } from "../../Components";
|
|
967
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
968
|
-
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
969
|
-
/** {@link Disposable.onDisposed} */
|
|
970
|
-
readonly onDisposed: Event<unknown>;
|
|
971
|
-
abstract three: THREE.Object3D;
|
|
972
|
-
protected constructor(components: Components);
|
|
973
|
-
/** {@link Disposable.dispose} */
|
|
974
|
-
dispose(): void;
|
|
975
|
-
}
|
|
976
|
-
import * as THREE from "three";
|
|
977
|
-
import { BaseScene } from "./base-scene";
|
|
978
|
-
import { BaseCamera } from "./base-camera";
|
|
979
|
-
import { BaseRenderer } from "./base-renderer";
|
|
980
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
981
|
-
export interface World extends Disposable, Updateable {
|
|
982
|
-
meshes: Set<THREE.Mesh>;
|
|
983
|
-
scene: BaseScene;
|
|
984
|
-
camera: BaseCamera;
|
|
985
|
-
renderer: BaseRenderer | null;
|
|
986
|
-
uuid: string;
|
|
987
|
-
}
|
|
988
|
-
import * as THREE from "three";
|
|
989
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
990
|
-
import { Components } from "../../Components";
|
|
991
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
992
|
-
/**
|
|
993
|
-
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
994
|
-
*/
|
|
995
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
996
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
997
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
998
|
-
enabled: boolean;
|
|
999
|
-
uuid: string;
|
|
1000
|
-
readonly onDisposed: Event<unknown>;
|
|
1001
|
-
private _scene?;
|
|
1002
|
-
private _camera?;
|
|
1003
|
-
private _renderer;
|
|
1004
|
-
get scene(): T;
|
|
1005
|
-
set scene(scene: T);
|
|
1006
|
-
get camera(): U;
|
|
1007
|
-
set camera(camera: U);
|
|
1008
|
-
get renderer(): S | null;
|
|
1009
|
-
set renderer(renderer: S | null);
|
|
1010
|
-
constructor(components: Components);
|
|
1011
|
-
update(delta?: number): void;
|
|
1012
|
-
dispose(disposeResources?: boolean): void;
|
|
1013
|
-
}
|
|
1014
|
-
import * as THREE from "three";
|
|
1015
|
-
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1016
|
-
import { Components } from "../../Components";
|
|
1017
|
-
export interface SimpleSceneConfig {
|
|
1018
|
-
directionalLight: {
|
|
1019
|
-
color: THREE.Color;
|
|
1020
|
-
intensity: number;
|
|
1021
|
-
position: THREE.Vector3;
|
|
1022
|
-
};
|
|
1023
|
-
ambientLight: {
|
|
1024
|
-
color: THREE.Color;
|
|
1025
|
-
intensity: number;
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
/**
|
|
1029
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1030
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1031
|
-
* @noInheritDoc
|
|
1032
|
-
*/
|
|
1033
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1034
|
-
/** {@link Configurable.isSetup} */
|
|
1035
|
-
isSetup: boolean;
|
|
1036
|
-
three: THREE.Scene;
|
|
1037
|
-
/** {@link Configurable.onSetup} */
|
|
1038
|
-
readonly onSetup: Event<SimpleScene>;
|
|
1039
|
-
config: Required<SimpleSceneConfig>;
|
|
1040
|
-
constructor(components: Components);
|
|
1041
|
-
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1042
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1043
|
-
}
|
|
1044
|
-
import * as THREE from "three";
|
|
1045
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
1046
|
-
import { Components } from "../../Components";
|
|
1047
|
-
/**
|
|
1048
|
-
* A basic renderer capable of rendering
|
|
1049
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1050
|
-
*/
|
|
1051
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1052
|
-
/** {@link Component.enabled} */
|
|
1053
|
-
enabled: boolean;
|
|
1054
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1055
|
-
container: HTMLElement | null;
|
|
1056
|
-
three: THREE.WebGLRenderer;
|
|
1057
|
-
protected _canvas: HTMLCanvasElement;
|
|
1058
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1059
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1060
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1061
|
-
/** {@link Updateable.update} */
|
|
1062
|
-
update(): void;
|
|
1063
|
-
/** {@link Disposable.dispose} */
|
|
1064
|
-
dispose(): void;
|
|
1065
|
-
/** {@link Resizeable.getSize}. */
|
|
1066
|
-
getSize(): THREE.Vector2;
|
|
1067
|
-
/** {@link Resizeable.resize} */
|
|
1068
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1069
|
-
setupEvents(active: boolean): void;
|
|
1070
|
-
private resizeEvent;
|
|
1071
|
-
private setupRenderer;
|
|
1072
|
-
private onContextLost;
|
|
1073
|
-
private onContextBack;
|
|
1074
|
-
private updateContainer;
|
|
1276
|
+
export interface Configurable<T extends Record<string, any>> {
|
|
1277
|
+
/** Wether this components has been already configured. */
|
|
1278
|
+
isSetup: boolean;
|
|
1279
|
+
/** Use the provided configuration to setup the tool. */
|
|
1280
|
+
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
1281
|
+
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
1282
|
+
readonly onSetup: Event<any>;
|
|
1283
|
+
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
1284
|
+
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
1285
|
+
*/
|
|
1286
|
+
config: Required<T>;
|
|
1075
1287
|
}
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1288
|
+
/**
|
|
1289
|
+
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
1290
|
+
*/
|
|
1291
|
+
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
1292
|
+
boundsTree: Object | undefined;
|
|
1293
|
+
disposeBoundsTree: () => void;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Whether a camera uses the Camera Controls library.
|
|
1297
|
+
*/
|
|
1298
|
+
export interface CameraControllable {
|
|
1299
|
+
controls: CameraControls;
|
|
1300
|
+
}
|
|
1301
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1079
1302
|
import { Components } from "../../Components";
|
|
1080
1303
|
/**
|
|
1081
|
-
*
|
|
1082
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1083
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1084
|
-
* what features it offers.
|
|
1304
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1085
1305
|
*/
|
|
1086
|
-
export declare class
|
|
1087
|
-
|
|
1088
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1089
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1090
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1091
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1092
|
-
/** {@link Disposable.onDisposed} */
|
|
1093
|
-
readonly onDisposed: Event<string>;
|
|
1094
|
-
readonly three: THREE.PerspectiveCamera;
|
|
1095
|
-
private _allControls;
|
|
1096
|
-
/**
|
|
1097
|
-
* The object that controls the camera. An instance of
|
|
1098
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1099
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1100
|
-
* object to move, rotate, look at objects, etc.
|
|
1101
|
-
*/
|
|
1102
|
-
get controls(): CameraControls;
|
|
1103
|
-
/** {@link Component.enabled} */
|
|
1104
|
-
get enabled(): boolean;
|
|
1105
|
-
/** {@link Component.enabled} */
|
|
1106
|
-
set enabled(enabled: boolean);
|
|
1306
|
+
export declare abstract class Base {
|
|
1307
|
+
components: Components;
|
|
1107
1308
|
constructor(components: Components);
|
|
1108
|
-
/** {@link Disposable.
|
|
1109
|
-
|
|
1110
|
-
/** {@link
|
|
1111
|
-
|
|
1112
|
-
/**
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
private newCameraControls;
|
|
1119
|
-
private setupEvents;
|
|
1120
|
-
private static getSubsetOfThree;
|
|
1309
|
+
/** Whether is component is {@link Disposable}. */
|
|
1310
|
+
isDisposeable: () => this is Disposable;
|
|
1311
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1312
|
+
isResizeable: () => this is Resizeable;
|
|
1313
|
+
/** Whether is component is {@link Updateable}. */
|
|
1314
|
+
isUpdateable: () => this is Updateable;
|
|
1315
|
+
/** Whether is component is {@link Hideable}. */
|
|
1316
|
+
isHideable: () => this is Hideable;
|
|
1317
|
+
/** Whether is component is {@link Configurable}. */
|
|
1318
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1121
1319
|
}
|
|
1122
|
-
import
|
|
1123
|
-
import { Disposable, Event } from "../../Types";
|
|
1320
|
+
import { Base } from "./base";
|
|
1124
1321
|
/**
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1127
|
-
*
|
|
1128
|
-
*
|
|
1322
|
+
* Components are the building blocks of this library. Components are singleton
|
|
1323
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
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.
|
|
1129
1328
|
*/
|
|
1130
|
-
export declare class
|
|
1131
|
-
dom: HTMLCanvasElement;
|
|
1132
|
-
private _event?;
|
|
1133
|
-
private _position;
|
|
1134
|
-
/** {@link Disposable.onDisposed} */
|
|
1135
|
-
readonly onDisposed: Event<unknown>;
|
|
1136
|
-
constructor(dom: HTMLCanvasElement);
|
|
1329
|
+
export declare abstract class Component extends Base {
|
|
1137
1330
|
/**
|
|
1138
|
-
*
|
|
1331
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
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.
|
|
1139
1335
|
*/
|
|
1140
|
-
|
|
1141
|
-
/** {@link Disposable.dispose} */
|
|
1142
|
-
dispose(): void;
|
|
1143
|
-
private getPositionY;
|
|
1144
|
-
private getPositionX;
|
|
1145
|
-
private updateMouseInfo;
|
|
1146
|
-
private setupEvents;
|
|
1336
|
+
abstract enabled: boolean;
|
|
1147
1337
|
}
|
|
1148
|
-
import
|
|
1338
|
+
import { Base } from "./base";
|
|
1339
|
+
import { World } from "./world";
|
|
1340
|
+
import { Event } from "./event";
|
|
1149
1341
|
import { Components } from "../../Components";
|
|
1150
|
-
import { Event, World, Disposable } from "../../Types";
|
|
1151
|
-
import { Mouse } from "./mouse";
|
|
1152
1342
|
/**
|
|
1153
|
-
*
|
|
1154
|
-
*
|
|
1155
|
-
* events.
|
|
1343
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1344
|
+
* or a renderer.
|
|
1156
1345
|
*/
|
|
1157
|
-
export declare class
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1346
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1347
|
+
readonly worlds: Map<string, World>;
|
|
1348
|
+
readonly onWorldChanged: Event<{
|
|
1349
|
+
world: World;
|
|
1350
|
+
action: "added" | "removed";
|
|
1351
|
+
}>;
|
|
1352
|
+
currentWorld: World | null;
|
|
1353
|
+
protected constructor(components: Components);
|
|
1354
|
+
}
|
|
1355
|
+
import * as THREE from "three";
|
|
1356
|
+
import CameraControls from "camera-controls";
|
|
1357
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1358
|
+
import { CameraControllable } from "./interfaces";
|
|
1359
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1360
|
+
abstract enabled: boolean;
|
|
1361
|
+
abstract three: THREE.Camera;
|
|
1362
|
+
abstract controls?: CameraControls;
|
|
1363
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1364
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1365
|
+
}
|
|
1366
|
+
import * as THREE from "three";
|
|
1367
|
+
import { Disposable } from "./interfaces";
|
|
1368
|
+
import { Event } from "./event";
|
|
1369
|
+
import { Components } from "../../Components";
|
|
1370
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1371
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1161
1372
|
/** {@link Disposable.onDisposed} */
|
|
1162
1373
|
readonly onDisposed: Event<unknown>;
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
readonly three: THREE.Raycaster;
|
|
1166
|
-
world: World;
|
|
1167
|
-
constructor(components: Components, world: World);
|
|
1374
|
+
abstract three: THREE.Object3D;
|
|
1375
|
+
protected constructor(components: Components);
|
|
1168
1376
|
/** {@link Disposable.dispose} */
|
|
1169
1377
|
dispose(): void;
|
|
1170
|
-
/**
|
|
1171
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1172
|
-
* the first item found. This also takes into account the clipping planes
|
|
1173
|
-
* used by the renderer.
|
|
1174
|
-
*
|
|
1175
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1176
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1177
|
-
* {@link Components.meshes}.
|
|
1178
|
-
*/
|
|
1179
|
-
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1180
|
-
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
1181
|
-
private intersect;
|
|
1182
|
-
private filterClippingPlanes;
|
|
1183
1378
|
}
|
|
1184
1379
|
import * as THREE from "three";
|
|
1185
|
-
import {
|
|
1186
|
-
import { Event
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
/**
|
|
1194
|
-
|
|
1195
|
-
*/
|
|
1196
|
-
export declare class CullerRenderer {
|
|
1380
|
+
import { Vector2 } from "three";
|
|
1381
|
+
import { Event } from "./event";
|
|
1382
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1383
|
+
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1384
|
+
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1385
|
+
abstract three: THREE.WebGLRenderer;
|
|
1386
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1387
|
+
onAfterUpdate: Event<unknown>;
|
|
1388
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1389
|
+
onBeforeUpdate: Event<unknown>;
|
|
1197
1390
|
/** {@link Disposable.onDisposed} */
|
|
1198
|
-
readonly onDisposed: Event<
|
|
1199
|
-
|
|
1200
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
1201
|
-
* meshes that are currently visible, and the ones that were visible
|
|
1202
|
-
* just before but not anymore.
|
|
1203
|
-
*/
|
|
1204
|
-
readonly onViewUpdated: Event<any>;
|
|
1205
|
-
/** {@link Component.enabled} */
|
|
1206
|
-
enabled: boolean;
|
|
1391
|
+
readonly onDisposed: Event<undefined>;
|
|
1392
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1207
1393
|
/**
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1394
|
+
* Event that fires when there has been a change to the list of clipping
|
|
1395
|
+
* planes used by the active renderer.
|
|
1210
1396
|
*/
|
|
1211
|
-
|
|
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;
|
|
1212
1402
|
/**
|
|
1213
|
-
*
|
|
1214
|
-
*
|
|
1403
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1404
|
+
* instance of the renderer.
|
|
1215
1405
|
*/
|
|
1216
|
-
|
|
1217
|
-
components: Components;
|
|
1218
|
-
readonly world: World;
|
|
1219
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
1220
|
-
protected autoUpdate: boolean;
|
|
1221
|
-
protected updateInterval: number;
|
|
1222
|
-
protected readonly worker: Worker;
|
|
1223
|
-
protected readonly scene: THREE.Scene;
|
|
1224
|
-
private _width;
|
|
1225
|
-
private _height;
|
|
1226
|
-
private _availableColor;
|
|
1227
|
-
private readonly renderTarget;
|
|
1228
|
-
private readonly bufferSize;
|
|
1229
|
-
private readonly _buffer;
|
|
1230
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1231
|
-
/** {@link Disposable.dispose} */
|
|
1232
|
-
dispose(): void;
|
|
1406
|
+
clippingPlanes: THREE.Plane[];
|
|
1233
1407
|
/**
|
|
1234
|
-
*
|
|
1235
|
-
*
|
|
1236
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1237
|
-
* not true.
|
|
1408
|
+
* Forces the update of the clipping planes and all components that depend
|
|
1409
|
+
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
1238
1410
|
*/
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
protected increaseColor(): void;
|
|
1247
|
-
protected decreaseColor(): void;
|
|
1248
|
-
private applySettings;
|
|
1411
|
+
updateClippingPlanes(): void;
|
|
1412
|
+
/**
|
|
1413
|
+
* Adds or removes a
|
|
1414
|
+
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
1415
|
+
* to the renderer.
|
|
1416
|
+
*/
|
|
1417
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1249
1418
|
}
|
|
1250
1419
|
import * as THREE from "three";
|
|
1251
|
-
import {
|
|
1252
|
-
import {
|
|
1253
|
-
import {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
unseen: Set<THREE.Mesh>;
|
|
1262
|
-
}>;
|
|
1263
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1264
|
-
isProcessing: boolean;
|
|
1265
|
-
private _colorCodeMeshMap;
|
|
1266
|
-
private _meshIDColorCodeMap;
|
|
1267
|
-
private _currentVisibleMeshes;
|
|
1268
|
-
private _recentlyHiddenMeshes;
|
|
1269
|
-
private readonly _transparentMat;
|
|
1270
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1271
|
-
dispose(): void;
|
|
1272
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1273
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1274
|
-
private handleWorkerMessage;
|
|
1275
|
-
private getAvailableMaterial;
|
|
1420
|
+
import { BaseScene } from "./base-scene";
|
|
1421
|
+
import { BaseCamera } from "./base-camera";
|
|
1422
|
+
import { BaseRenderer } from "./base-renderer";
|
|
1423
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
1424
|
+
export interface World extends Disposable, Updateable {
|
|
1425
|
+
meshes: Set<THREE.Mesh>;
|
|
1426
|
+
scene: BaseScene;
|
|
1427
|
+
camera: BaseCamera;
|
|
1428
|
+
renderer: BaseRenderer | null;
|
|
1429
|
+
uuid: string;
|
|
1276
1430
|
}
|
|
1277
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1278
1431
|
/// <reference types="node" />
|
|
1279
1432
|
import * as THREE from "three";
|
|
1280
1433
|
import { Hideable, Event, World } from "../../Types";
|
|
@@ -1323,160 +1476,6 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
1323
1476
|
private setupEvents;
|
|
1324
1477
|
private updateZoom;
|
|
1325
1478
|
}
|
|
1326
|
-
import * as THREE from "three";
|
|
1327
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1328
|
-
import { Components } from "../../Components";
|
|
1329
|
-
/**
|
|
1330
|
-
* Each of the planes created by {@link SimpleClipper}.
|
|
1331
|
-
*/
|
|
1332
|
-
export declare class SimplePlane implements Disposable, Hideable {
|
|
1333
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1334
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
1335
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1336
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
1337
|
-
/** {@link Disposable.onDisposed} */
|
|
1338
|
-
readonly onDisposed: Event<unknown>;
|
|
1339
|
-
readonly normal: THREE.Vector3;
|
|
1340
|
-
readonly origin: THREE.Vector3;
|
|
1341
|
-
readonly three: THREE.Plane;
|
|
1342
|
-
protected readonly _helper: THREE.Object3D;
|
|
1343
|
-
protected _visible: boolean;
|
|
1344
|
-
protected _enabled: boolean;
|
|
1345
|
-
components: Components;
|
|
1346
|
-
world: World;
|
|
1347
|
-
private _controlsActive;
|
|
1348
|
-
private readonly _arrowBoundBox;
|
|
1349
|
-
private readonly _planeMesh;
|
|
1350
|
-
private readonly _controls;
|
|
1351
|
-
private readonly _hiddenMaterial;
|
|
1352
|
-
get enabled(): boolean;
|
|
1353
|
-
/** {@link Component.enabled} */
|
|
1354
|
-
set enabled(state: boolean);
|
|
1355
|
-
/** {@link Hideable.visible } */
|
|
1356
|
-
get visible(): boolean;
|
|
1357
|
-
/** {@link Hideable.visible } */
|
|
1358
|
-
set visible(state: boolean);
|
|
1359
|
-
/** The meshes used for raycasting */
|
|
1360
|
-
get meshes(): THREE.Mesh[];
|
|
1361
|
-
/** The material of the clipping plane representation. */
|
|
1362
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1363
|
-
/** The material of the clipping plane representation. */
|
|
1364
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1365
|
-
/** The size of the clipping plane representation. */
|
|
1366
|
-
get size(): number;
|
|
1367
|
-
/** Sets the size of the clipping plane representation. */
|
|
1368
|
-
set size(size: number);
|
|
1369
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1370
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1371
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1372
|
-
/** {@link Updateable.update} */
|
|
1373
|
-
update: () => Promise<void>;
|
|
1374
|
-
/** {@link Disposable.dispose} */
|
|
1375
|
-
dispose(): void;
|
|
1376
|
-
private reset;
|
|
1377
|
-
protected toggleControls(state: boolean): void;
|
|
1378
|
-
private newTransformControls;
|
|
1379
|
-
private initializeControls;
|
|
1380
|
-
private createArrowBoundingBox;
|
|
1381
|
-
private changeDrag;
|
|
1382
|
-
private notifyDraggingChanged;
|
|
1383
|
-
private preventCameraMovement;
|
|
1384
|
-
private newHelper;
|
|
1385
|
-
private static newPlaneMesh;
|
|
1386
|
-
}
|
|
1387
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1388
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1389
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1390
|
-
minGeometrySize: number;
|
|
1391
|
-
minAssetsSize: number;
|
|
1392
|
-
}
|
|
1393
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1394
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1395
|
-
propertiesSize: number;
|
|
1396
|
-
}
|
|
1397
|
-
import * as WEBIFC from "web-ifc";
|
|
1398
|
-
import { Component, Disposable, Event } from "../../../core";
|
|
1399
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1400
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1401
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1402
|
-
onPropertiesStreamed: Event<{
|
|
1403
|
-
type: number;
|
|
1404
|
-
data: {
|
|
1405
|
-
[id: number]: any;
|
|
1406
|
-
};
|
|
1407
|
-
}>;
|
|
1408
|
-
onProgress: Event<number>;
|
|
1409
|
-
onIndicesStreamed: Event<number[][]>;
|
|
1410
|
-
/** {@link Disposable.onDisposed} */
|
|
1411
|
-
readonly onDisposed: Event<string>;
|
|
1412
|
-
enabled: boolean;
|
|
1413
|
-
settings: PropertiesStreamingSettings;
|
|
1414
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1415
|
-
dispose(): Promise<void>;
|
|
1416
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1417
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1418
|
-
private readIfcFile;
|
|
1419
|
-
private streamIfcFile;
|
|
1420
|
-
private streamAllProperties;
|
|
1421
|
-
private getIndices;
|
|
1422
|
-
private cleanUp;
|
|
1423
|
-
}
|
|
1424
|
-
import * as WEBIFC from "web-ifc";
|
|
1425
|
-
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1426
|
-
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1427
|
-
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1428
|
-
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1429
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1430
|
-
onGeometryStreamed: Event<{
|
|
1431
|
-
buffer: Uint8Array;
|
|
1432
|
-
data: StreamedGeometries;
|
|
1433
|
-
}>;
|
|
1434
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1435
|
-
onProgress: Event<number>;
|
|
1436
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
1437
|
-
/** {@link Disposable.onDisposed} */
|
|
1438
|
-
readonly onDisposed: Event<unknown>;
|
|
1439
|
-
settings: IfcStreamingSettings;
|
|
1440
|
-
enabled: boolean;
|
|
1441
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1442
|
-
private _spatialTree;
|
|
1443
|
-
private _metaData;
|
|
1444
|
-
private _visitedGeometries;
|
|
1445
|
-
private _streamSerializer;
|
|
1446
|
-
private _geometries;
|
|
1447
|
-
private _geometryCount;
|
|
1448
|
-
private _civil;
|
|
1449
|
-
private _groupSerializer;
|
|
1450
|
-
private _assets;
|
|
1451
|
-
private _meshesWithHoles;
|
|
1452
|
-
constructor(components: Components);
|
|
1453
|
-
dispose(): void;
|
|
1454
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1455
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1456
|
-
private readIfcFile;
|
|
1457
|
-
private streamIfcFile;
|
|
1458
|
-
private streamAllGeometries;
|
|
1459
|
-
private cleanUp;
|
|
1460
|
-
private getMesh;
|
|
1461
|
-
private getGeometry;
|
|
1462
|
-
private streamAssets;
|
|
1463
|
-
private streamGeometries;
|
|
1464
|
-
}
|
|
1465
|
-
export interface StreamedGeometries {
|
|
1466
|
-
[id: number]: {
|
|
1467
|
-
boundingBox: Float32Array;
|
|
1468
|
-
hasHoles: boolean;
|
|
1469
|
-
geometryFile?: string;
|
|
1470
|
-
};
|
|
1471
|
-
}
|
|
1472
|
-
export interface StreamedAsset {
|
|
1473
|
-
id: number;
|
|
1474
|
-
geometries: {
|
|
1475
|
-
geometryID: number;
|
|
1476
|
-
transformation: number[];
|
|
1477
|
-
color: number[];
|
|
1478
|
-
}[];
|
|
1479
|
-
}
|
|
1480
1479
|
import * as WEBIFC from "web-ifc";
|
|
1481
1480
|
import * as THREE from "three";
|
|
1482
1481
|
export declare class Units {
|
|
@@ -1487,21 +1486,6 @@ export declare class Units {
|
|
|
1487
1486
|
private getLengthUnits;
|
|
1488
1487
|
private getScaleMatrix;
|
|
1489
1488
|
}
|
|
1490
|
-
import * as THREE from "three";
|
|
1491
|
-
import * as WEBIFC from "web-ifc";
|
|
1492
|
-
import * as FRAGS from "bim-fragment";
|
|
1493
|
-
export declare class CivilReader {
|
|
1494
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1495
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1496
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1497
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1498
|
-
} | undefined;
|
|
1499
|
-
get(civilItems: any): {
|
|
1500
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1501
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1502
|
-
} | undefined;
|
|
1503
|
-
private getCurves;
|
|
1504
|
-
}
|
|
1505
1489
|
import * as WEBIFC from "web-ifc";
|
|
1506
1490
|
/** Configuration of the IFC-fragment conversion. */
|
|
1507
1491
|
export declare class IfcFragmentSettings {
|
|
@@ -1529,6 +1513,21 @@ export declare class IfcFragmentSettings {
|
|
|
1529
1513
|
autoSetWasm: boolean;
|
|
1530
1514
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1531
1515
|
}
|
|
1516
|
+
import * as THREE from "three";
|
|
1517
|
+
import * as WEBIFC from "web-ifc";
|
|
1518
|
+
import * as FRAGS from "bim-fragment";
|
|
1519
|
+
export declare class CivilReader {
|
|
1520
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1521
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1522
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1523
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1524
|
+
} | undefined;
|
|
1525
|
+
get(civilItems: any): {
|
|
1526
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1527
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1528
|
+
} | undefined;
|
|
1529
|
+
private getCurves;
|
|
1530
|
+
}
|
|
1532
1531
|
import * as WEBIFC from "web-ifc";
|
|
1533
1532
|
export declare class IfcMetadataReader {
|
|
1534
1533
|
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
@@ -1538,6 +1537,21 @@ import * as THREE from "three";
|
|
|
1538
1537
|
export declare class TransformHelper {
|
|
1539
1538
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1540
1539
|
}
|
|
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
|
+
}
|
|
1541
1555
|
export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
|
|
1542
1556
|
export type ConditionFunctions = {
|
|
1543
1557
|
[queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
|
|
@@ -1561,20 +1575,5 @@ export interface Query {
|
|
|
1561
1575
|
description?: string;
|
|
1562
1576
|
groups: QueryGroup;
|
|
1563
1577
|
}
|
|
1564
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1565
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
1566
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1567
|
-
enabled: boolean;
|
|
1568
|
-
height: number;
|
|
1569
|
-
groupName: string;
|
|
1570
|
-
/** {@link Disposable.onDisposed} */
|
|
1571
|
-
readonly onDisposed: Event<string>;
|
|
1572
|
-
list: Set<string>;
|
|
1573
|
-
constructor(components: Components);
|
|
1574
|
-
dispose(): void;
|
|
1575
|
-
explode(): void;
|
|
1576
|
-
reset(): void;
|
|
1577
|
-
update(): void;
|
|
1578
|
-
}
|
|
1579
1578
|
|
|
1580
1579
|
}
|