@thatopen/components 2.0.0-alpha.6 → 2.0.0-alpha.8
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 +3 -3
- package/dist/core/Materials/index.d.ts +3 -15
- package/dist/core/Worlds/src/simple-renderer.d.ts +3 -4
- package/dist/core/index.d.ts +2 -0
- package/dist/fragments/FragmentClassifier/index.d.ts +4 -3
- package/dist/fragments/FragmentIfcLoader/src/index.d.ts +1 -0
- package/dist/fragments/{FragmentIfcStreamer/src/fragment-ifc-stream-converter.d.ts → IfcGeometryTiler/index.d.ts} +4 -4
- package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/fragment-props-stream-converter.d.ts +4 -4
- package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +26 -0
- package/dist/fragments/index.d.ts +2 -1
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +135 -0
- package/dist/ifc/IfcRelationsIndexer/src/getRelationMap.d.ts +3 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +4 -0
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +24 -0
- package/dist/ifc/index.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +2545 -2142
- package/dist/namespace.d.ts +886 -738
- package/package.json +5 -4
- package/dist/fragments/FragmentIfcStreamer/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesIndexer/index.d.ts +0 -31
- package/dist/navigation/index.d.ts +0 -1
- /package/dist/{navigation → core}/MiniMap/index.d.ts +0 -0
- /package/dist/{navigation → core}/MiniMap/src/index.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/index.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/index.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/projections.d.ts +0 -0
- /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/types.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/base-types.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/streaming-settings.d.ts +0 -0
package/dist/namespace.d.ts
CHANGED
|
@@ -42,19 +42,6 @@ export declare class Disposer extends Component {
|
|
|
42
42
|
private disposeChildren;
|
|
43
43
|
private static disposeMaterial;
|
|
44
44
|
}
|
|
45
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
46
|
-
import { SimpleRaycaster } from "./src";
|
|
47
|
-
import { Components } from "../Components";
|
|
48
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
49
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
50
|
-
enabled: boolean;
|
|
51
|
-
list: Map<string, SimpleRaycaster>;
|
|
52
|
-
onDisposed: Event<unknown>;
|
|
53
|
-
constructor(components: Components);
|
|
54
|
-
get(world: World): SimpleRaycaster;
|
|
55
|
-
delete(world: World): void;
|
|
56
|
-
dispose(): void;
|
|
57
|
-
}
|
|
58
45
|
import { Component, Disposable, Event } from "../Types";
|
|
59
46
|
/**
|
|
60
47
|
* The entry point of the Components library.
|
|
@@ -108,6 +95,35 @@ export declare class Components implements Disposable {
|
|
|
108
95
|
private static setupBVH;
|
|
109
96
|
}
|
|
110
97
|
import { Component, Disposable, World, Event } from "../Types";
|
|
98
|
+
import { SimpleRaycaster } from "./src";
|
|
99
|
+
import { Components } from "../Components";
|
|
100
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
101
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
list: Map<string, SimpleRaycaster>;
|
|
104
|
+
onDisposed: Event<unknown>;
|
|
105
|
+
constructor(components: Components);
|
|
106
|
+
get(world: World): SimpleRaycaster;
|
|
107
|
+
delete(world: World): void;
|
|
108
|
+
dispose(): void;
|
|
109
|
+
}
|
|
110
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
111
|
+
import { Components } from "../Components";
|
|
112
|
+
import { SimpleWorld } from "./src";
|
|
113
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
114
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
115
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
116
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
117
|
+
readonly onDisposed: Event<unknown>;
|
|
118
|
+
list: Map<string, World>;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
constructor(components: Components);
|
|
121
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
122
|
+
delete(world: World): void;
|
|
123
|
+
dispose(): void;
|
|
124
|
+
update(delta?: number): void | Promise<void>;
|
|
125
|
+
}
|
|
126
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
111
127
|
import { GridConfig, SimpleGrid } from "./src";
|
|
112
128
|
export declare class Grids extends Component implements Disposable {
|
|
113
129
|
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
@@ -164,7 +180,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
164
180
|
list: T[];
|
|
165
181
|
protected PlaneType: new (...args: any) => SimplePlane | T;
|
|
166
182
|
/** The material used in all the clipping planes. */
|
|
167
|
-
protected _material: THREE.
|
|
183
|
+
protected _material: THREE.MeshBasicMaterial;
|
|
168
184
|
private _size;
|
|
169
185
|
private _enabled;
|
|
170
186
|
private _visible;
|
|
@@ -177,9 +193,9 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
177
193
|
/** {@link Hideable.visible } */
|
|
178
194
|
set visible(state: boolean);
|
|
179
195
|
/** The material of the clipping plane representation. */
|
|
180
|
-
get material(): THREE.
|
|
196
|
+
get material(): THREE.MeshBasicMaterial;
|
|
181
197
|
/** The material of the clipping plane representation. */
|
|
182
|
-
set material(material: THREE.
|
|
198
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
183
199
|
/** The size of the geometric representation of the clippings planes. */
|
|
184
200
|
get size(): number;
|
|
185
201
|
/** The size of the geometric representation of the clippings planes. */
|
|
@@ -223,24 +239,53 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
223
239
|
private _onStartDragging;
|
|
224
240
|
private _onEndDragging;
|
|
225
241
|
}
|
|
226
|
-
import
|
|
242
|
+
import * as THREE from "three";
|
|
243
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
244
|
+
center: THREE.Vector3;
|
|
245
|
+
halfSizes: THREE.Vector3;
|
|
246
|
+
rotation: THREE.Matrix3;
|
|
247
|
+
transformation: THREE.Matrix4;
|
|
248
|
+
};
|
|
249
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
227
250
|
import { Components } from "../Components";
|
|
228
|
-
import {
|
|
229
|
-
|
|
230
|
-
|
|
251
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
252
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
253
|
+
/**
|
|
254
|
+
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
255
|
+
* that are not visible to the camera.
|
|
256
|
+
*/
|
|
257
|
+
export declare class Cullers extends Component implements Disposable {
|
|
258
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
259
|
+
private _enabled;
|
|
260
|
+
list: Map<string, MeshCullerRenderer>;
|
|
261
|
+
/** {@link Disposable.onDisposed} */
|
|
262
|
+
readonly onDisposed: Event<unknown>;
|
|
263
|
+
/** {@link Component.enabled} */
|
|
264
|
+
get enabled(): boolean;
|
|
265
|
+
set enabled(value: boolean);
|
|
266
|
+
constructor(components: Components);
|
|
267
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
268
|
+
delete(world: World): void;
|
|
269
|
+
/** {@link Disposable.dispose} */
|
|
270
|
+
dispose(): void;
|
|
271
|
+
}
|
|
272
|
+
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
273
|
+
import { MiniMap } from "./src";
|
|
274
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
275
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
231
276
|
readonly onAfterUpdate: Event<unknown>;
|
|
232
277
|
readonly onBeforeUpdate: Event<unknown>;
|
|
233
278
|
readonly onDisposed: Event<unknown>;
|
|
234
|
-
list: Map<string, World>;
|
|
235
279
|
enabled: boolean;
|
|
280
|
+
list: Map<string, MiniMap>;
|
|
236
281
|
constructor(components: Components);
|
|
237
|
-
create
|
|
238
|
-
delete(
|
|
239
|
-
dispose(): void
|
|
240
|
-
update(
|
|
282
|
+
create(world: World): MiniMap;
|
|
283
|
+
delete(id: string): void;
|
|
284
|
+
dispose(): void | Promise<void>;
|
|
285
|
+
update(): void;
|
|
241
286
|
}
|
|
242
287
|
import * as THREE from "three";
|
|
243
|
-
import { Component, Disposable, Event
|
|
288
|
+
import { Component, Disposable, Event } from "../Types";
|
|
244
289
|
import { Components } from "../Components";
|
|
245
290
|
/**
|
|
246
291
|
* A tool to easily handle the materials of massive amounts of
|
|
@@ -250,7 +295,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
250
295
|
static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
|
|
251
296
|
/** {@link Component.enabled} */
|
|
252
297
|
enabled: boolean;
|
|
253
|
-
private _originalBackground;
|
|
254
298
|
/** {@link Disposable.onDisposed} */
|
|
255
299
|
readonly onDisposed: Event<string>;
|
|
256
300
|
list: {
|
|
@@ -261,6 +305,8 @@ export declare class Materials extends Component implements Disposable {
|
|
|
261
305
|
};
|
|
262
306
|
private _originals;
|
|
263
307
|
constructor(components: Components);
|
|
308
|
+
/** {@link Disposable.dispose} */
|
|
309
|
+
dispose(): void;
|
|
264
310
|
/**
|
|
265
311
|
* Turns the specified material styles on or off.
|
|
266
312
|
*
|
|
@@ -268,19 +314,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
268
314
|
* @param ids the ids of the style to turn on or off.
|
|
269
315
|
*/
|
|
270
316
|
set(active: boolean, ids?: string[]): void;
|
|
271
|
-
/** {@link Disposable.dispose} */
|
|
272
|
-
dispose(): void;
|
|
273
|
-
/**
|
|
274
|
-
* Sets the color of the background of the scene.
|
|
275
|
-
*
|
|
276
|
-
* @param color: the color to apply.
|
|
277
|
-
*/
|
|
278
|
-
setBackgroundColor(color: THREE.Color, world: World): void;
|
|
279
|
-
/**
|
|
280
|
-
* Resets the scene background to the color that was being used
|
|
281
|
-
* before applying the material manager.
|
|
282
|
-
*/
|
|
283
|
-
resetBackgroundColor(world: World): void;
|
|
284
317
|
/**
|
|
285
318
|
* Creates a new material style.
|
|
286
319
|
* @param id the identifier of the style to create.
|
|
@@ -300,28 +333,6 @@ export declare class Materials extends Component implements Disposable {
|
|
|
300
333
|
*/
|
|
301
334
|
removeMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
302
335
|
}
|
|
303
|
-
import { Components } from "../Components";
|
|
304
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
305
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
306
|
-
/**
|
|
307
|
-
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
308
|
-
* that are not visible to the camera.
|
|
309
|
-
*/
|
|
310
|
-
export declare class Cullers extends Component implements Disposable {
|
|
311
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
312
|
-
private _enabled;
|
|
313
|
-
list: Map<string, MeshCullerRenderer>;
|
|
314
|
-
/** {@link Disposable.onDisposed} */
|
|
315
|
-
readonly onDisposed: Event<unknown>;
|
|
316
|
-
/** {@link Component.enabled} */
|
|
317
|
-
get enabled(): boolean;
|
|
318
|
-
set enabled(value: boolean);
|
|
319
|
-
constructor(components: Components);
|
|
320
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
321
|
-
delete(world: World): void;
|
|
322
|
-
/** {@link Disposable.dispose} */
|
|
323
|
-
dispose(): void;
|
|
324
|
-
}
|
|
325
336
|
import * as THREE from "three";
|
|
326
337
|
import { Components } from "../../core/Components";
|
|
327
338
|
import { SimpleCamera } from "../../core";
|
|
@@ -371,253 +382,193 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
371
382
|
private newOrthoCamera;
|
|
372
383
|
private setOrthoCameraAspect;
|
|
373
384
|
}
|
|
374
|
-
import * as
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
export declare class
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
p3: THREE.Vector3;
|
|
390
|
-
faceNormal: THREE.Vector3;
|
|
391
|
-
};
|
|
392
|
-
private static round;
|
|
385
|
+
import * as WEBIFC from "web-ifc";
|
|
386
|
+
import * as FRAG from "@thatopen/fragments";
|
|
387
|
+
/**
|
|
388
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
389
|
+
*/
|
|
390
|
+
export declare class IfcJsonExporter {
|
|
391
|
+
/**
|
|
392
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
393
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
394
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
395
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
396
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
397
|
+
* to make the location data available (e.g. absolute position of building).
|
|
398
|
+
*/
|
|
399
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
393
400
|
}
|
|
394
|
-
import * as THREE from "three";
|
|
395
401
|
import * as FRAGS from "@thatopen/fragments";
|
|
396
402
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
397
|
-
import {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
404
|
-
/** {@link Component.enabled} */
|
|
405
|
-
enabled: boolean;
|
|
406
|
-
/** {@link Disposable.onDisposed} */
|
|
407
|
-
readonly onDisposed: Event<unknown>;
|
|
408
|
-
private _absoluteMin;
|
|
409
|
-
private _absoluteMax;
|
|
410
|
-
private _meshes;
|
|
411
|
-
constructor(components: Components);
|
|
412
|
-
static getDimensions(bbox: THREE.Box3): {
|
|
413
|
-
width: number;
|
|
414
|
-
height: number;
|
|
415
|
-
depth: number;
|
|
416
|
-
center: THREE.Vector3;
|
|
403
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
404
|
+
import { QueryGroup } from "./src/types";
|
|
405
|
+
export interface QueryResult {
|
|
406
|
+
[modelID: string]: {
|
|
407
|
+
modelEntities: Set<number>;
|
|
408
|
+
otherEntities: Set<number>;
|
|
417
409
|
};
|
|
418
|
-
static newBound(positive: boolean): THREE.Vector3;
|
|
419
|
-
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
420
|
-
/** {@link Disposable.dispose} */
|
|
421
|
-
dispose(): void;
|
|
422
|
-
get(): THREE.Box3;
|
|
423
|
-
getSphere(): THREE.Sphere;
|
|
424
|
-
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
425
|
-
reset(): void;
|
|
426
|
-
add(group: FragmentsGroup): void;
|
|
427
|
-
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
428
|
-
private static getFragmentBounds;
|
|
429
410
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
411
|
+
export interface IndexedModels {
|
|
412
|
+
[modelID: string]: {
|
|
413
|
+
[expressID: number]: Set<number>;
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
417
|
+
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
418
|
+
/** {@link Disposable.onDisposed} */
|
|
419
|
+
readonly onDisposed: Event<unknown>;
|
|
434
420
|
enabled: boolean;
|
|
421
|
+
indexedModels: IndexedModels;
|
|
422
|
+
private readonly _conditionFunctions;
|
|
423
|
+
private _noHandleAttributes;
|
|
435
424
|
constructor(components: Components);
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
private
|
|
425
|
+
private onFragmentsDisposed;
|
|
426
|
+
dispose(): void;
|
|
427
|
+
private indexEntityRelations;
|
|
428
|
+
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
429
|
+
private toFragmentMap;
|
|
430
|
+
private simpleQuery;
|
|
431
|
+
private getMatchingEntities;
|
|
432
|
+
private combineArrays;
|
|
433
|
+
private getCommonElements;
|
|
434
|
+
private arrayIntersection;
|
|
435
|
+
private arrayUnion;
|
|
436
|
+
private getConditionFunctions;
|
|
439
437
|
}
|
|
440
438
|
import * as WEBIFC from "web-ifc";
|
|
441
|
-
import
|
|
442
|
-
import {
|
|
443
|
-
import {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
439
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
440
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
441
|
+
import { RelationsMap, ModelsRelationMap, InverseAttributes, InverseAttribute } from "./src/types";
|
|
442
|
+
/**
|
|
443
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
444
|
+
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
445
|
+
*/
|
|
446
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
447
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
448
448
|
/** {@link Disposable.onDisposed} */
|
|
449
449
|
readonly onDisposed: Event<string>;
|
|
450
|
-
settings: IfcFragmentSettings;
|
|
451
450
|
enabled: boolean;
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
private
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
import * as THREE from "three";
|
|
473
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
474
|
-
center: THREE.Vector3;
|
|
475
|
-
halfSizes: THREE.Vector3;
|
|
476
|
-
rotation: THREE.Matrix3;
|
|
477
|
-
transformation: THREE.Matrix4;
|
|
478
|
-
};
|
|
479
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
480
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
481
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
482
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
483
|
-
enabled: boolean;
|
|
484
|
-
height: number;
|
|
485
|
-
groupName: string;
|
|
486
|
-
/** {@link Disposable.onDisposed} */
|
|
487
|
-
readonly onDisposed: Event<string>;
|
|
488
|
-
list: Set<string>;
|
|
489
|
-
constructor(components: Components);
|
|
490
|
-
dispose(): void;
|
|
491
|
-
explode(): void;
|
|
492
|
-
reset(): void;
|
|
493
|
-
update(): void;
|
|
494
|
-
}
|
|
495
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
496
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
497
|
-
export interface Classification {
|
|
498
|
-
[system: string]: {
|
|
499
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
export declare class FragmentClassifier extends Component implements Disposable {
|
|
503
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
504
|
-
/** {@link Component.enabled} */
|
|
505
|
-
enabled: boolean;
|
|
506
|
-
private _groupSystems;
|
|
507
|
-
/** {@link Disposable.onDisposed} */
|
|
508
|
-
readonly onDisposed: Event<unknown>;
|
|
451
|
+
readonly onRelationsIndexed: Event<{
|
|
452
|
+
modelID: string;
|
|
453
|
+
relationsMap: RelationsMap;
|
|
454
|
+
}>;
|
|
455
|
+
private _relToAttributesMap;
|
|
456
|
+
/**
|
|
457
|
+
* Array of inverse attribute names.
|
|
458
|
+
* This array is used to define the inverse attributes that the indexer will process and index.
|
|
459
|
+
*/
|
|
460
|
+
readonly inverseAttributes: InverseAttributes;
|
|
461
|
+
/**
|
|
462
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
463
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
464
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
465
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
466
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
467
|
+
* of entity relationships within a model.
|
|
468
|
+
*/
|
|
469
|
+
readonly relationMaps: ModelsRelationMap;
|
|
509
470
|
constructor(components: Components);
|
|
510
471
|
private onFragmentsDisposed;
|
|
511
|
-
|
|
512
|
-
get(): Classification;
|
|
513
|
-
dispose(): void;
|
|
514
|
-
remove(guid: string): void;
|
|
515
|
-
find(filter?: {
|
|
516
|
-
[name: string]: string[];
|
|
517
|
-
}): FRAGS.FragmentIdMap;
|
|
518
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
519
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
520
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
521
|
-
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
522
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
523
|
-
private saveItem;
|
|
524
|
-
}
|
|
525
|
-
import * as WEBIFC from "web-ifc";
|
|
526
|
-
import * as FRAG from "@thatopen/fragments";
|
|
527
|
-
/**
|
|
528
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
529
|
-
*/
|
|
530
|
-
export declare class IfcJsonExporter {
|
|
472
|
+
private getAttributeRels;
|
|
531
473
|
/**
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
* @param
|
|
535
|
-
* @param
|
|
536
|
-
*
|
|
537
|
-
*
|
|
474
|
+
* Adds a relation map to the model's relations map.
|
|
475
|
+
*
|
|
476
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
477
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
478
|
+
*
|
|
479
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
538
480
|
*/
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
542
|
-
import * as THREE from "three";
|
|
543
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
544
|
-
/**
|
|
545
|
-
* Object that can efficiently load binary files that contain
|
|
546
|
-
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
547
|
-
*/
|
|
548
|
-
export declare class FragmentManager extends Component implements Disposable {
|
|
549
|
-
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
550
|
-
/** {@link Disposable.onDisposed} */
|
|
551
|
-
readonly onDisposed: Event<unknown>;
|
|
552
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
553
|
-
readonly onFragmentsDisposed: Event<{
|
|
554
|
-
groupID: string;
|
|
555
|
-
fragmentIDs: string[];
|
|
556
|
-
}>;
|
|
557
|
-
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
558
|
-
readonly list: Map<string, Fragment>;
|
|
559
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
560
|
-
/** {@link Component.enabled} */
|
|
561
|
-
enabled: boolean;
|
|
562
|
-
baseCoordinationModel: string;
|
|
563
|
-
private _loader;
|
|
564
|
-
/** The list of meshes of the created fragments. */
|
|
565
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
566
|
-
constructor(components: Components);
|
|
567
|
-
/** {@link Disposable.dispose} */
|
|
568
|
-
dispose(): void;
|
|
569
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
481
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
570
482
|
/**
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
483
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
484
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
485
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
486
|
+
*
|
|
487
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
488
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
489
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
490
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
491
|
+
* of entities that are related through that attribute.
|
|
492
|
+
*
|
|
493
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
494
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
495
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
496
|
+
* @throws An error if the model does not have properties loaded.
|
|
575
497
|
*/
|
|
576
|
-
|
|
498
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
577
499
|
/**
|
|
578
|
-
*
|
|
579
|
-
*
|
|
580
|
-
* @
|
|
500
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
|
|
501
|
+
*
|
|
502
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
503
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
504
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
505
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
506
|
+
*/
|
|
507
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
508
|
+
/**
|
|
509
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
510
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
511
|
+
* returning the IDs of related entities if a match is found.
|
|
512
|
+
*
|
|
513
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
514
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
515
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
516
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
517
|
+
* or the specified relation name is not indexed.
|
|
518
|
+
*/
|
|
519
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
520
|
+
/**
|
|
521
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
522
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
523
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
524
|
+
* The resulting object is then serialized into a JSON string.
|
|
525
|
+
*
|
|
526
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
527
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
528
|
+
*/
|
|
529
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
530
|
+
/**
|
|
531
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
532
|
+
* This method iterates through the relations indexed for the given model,
|
|
533
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
534
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
535
|
+
* The resulting object is then serialized into a JSON string.
|
|
536
|
+
*
|
|
537
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
538
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
539
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
540
|
+
*/
|
|
541
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
542
|
+
/**
|
|
543
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
544
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
545
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
546
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
547
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
548
|
+
*
|
|
549
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
550
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
551
|
+
*/
|
|
552
|
+
serializeAllRelations(): string;
|
|
553
|
+
/**
|
|
554
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
555
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
556
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
557
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
558
|
+
* of express IDs of entities related through that relation type.
|
|
559
|
+
*
|
|
560
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
561
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
562
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
563
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
564
|
+
*/
|
|
565
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
566
|
+
/**
|
|
567
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
568
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
569
|
+
* references that could prevent garbage collection.
|
|
581
570
|
*/
|
|
582
|
-
export(group: FragmentsGroup): Uint8Array;
|
|
583
|
-
coordinate(models?: FragmentsGroup[]): void;
|
|
584
|
-
}
|
|
585
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
586
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
587
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
588
|
-
import { QueryGroup } from "./src/types";
|
|
589
|
-
export interface QueryResult {
|
|
590
|
-
[modelID: string]: {
|
|
591
|
-
modelEntities: Set<number>;
|
|
592
|
-
otherEntities: Set<number>;
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
export interface IndexedModels {
|
|
596
|
-
[modelID: string]: {
|
|
597
|
-
[expressID: number]: Set<number>;
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
601
|
-
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
602
|
-
/** {@link Disposable.onDisposed} */
|
|
603
|
-
readonly onDisposed: Event<unknown>;
|
|
604
|
-
enabled: boolean;
|
|
605
|
-
indexedModels: IndexedModels;
|
|
606
|
-
private readonly _conditionFunctions;
|
|
607
|
-
private _noHandleAttributes;
|
|
608
|
-
constructor(components: Components);
|
|
609
|
-
private onFragmentsDisposed;
|
|
610
571
|
dispose(): void;
|
|
611
|
-
private indexEntityRelations;
|
|
612
|
-
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
613
|
-
private toFragmentMap;
|
|
614
|
-
private simpleQuery;
|
|
615
|
-
private getMatchingEntities;
|
|
616
|
-
private combineArrays;
|
|
617
|
-
private getCommonElements;
|
|
618
|
-
private arrayIntersection;
|
|
619
|
-
private arrayUnion;
|
|
620
|
-
private getConditionFunctions;
|
|
621
572
|
}
|
|
622
573
|
import * as WEBIFC from "web-ifc";
|
|
623
574
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -692,37 +643,6 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
692
643
|
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
693
644
|
}
|
|
694
645
|
export {};
|
|
695
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
696
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
697
|
-
import { IfcPropertiesManager } from "../IfcPropertiesManager";
|
|
698
|
-
interface IndexMap {
|
|
699
|
-
[modelID: string]: {
|
|
700
|
-
[expressID: string]: Set<number>;
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
export declare class IfcPropertiesIndexer extends Component implements Disposable {
|
|
704
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
705
|
-
/** {@link Disposable.onDisposed} */
|
|
706
|
-
readonly onDisposed: Event<string>;
|
|
707
|
-
enabled: boolean;
|
|
708
|
-
relationsToProcess: number[];
|
|
709
|
-
indexMap: IndexMap;
|
|
710
|
-
private _propertiesManager;
|
|
711
|
-
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>;
|
|
712
|
-
set propertiesManager(manager: IfcPropertiesManager | null);
|
|
713
|
-
get propertiesManager(): IfcPropertiesManager | null;
|
|
714
|
-
constructor(components: Components);
|
|
715
|
-
private onFragmentsDisposed;
|
|
716
|
-
dispose(): Promise<void>;
|
|
717
|
-
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>;
|
|
718
|
-
private getNestedPsets;
|
|
719
|
-
private getPsetProperties;
|
|
720
|
-
process(model: FragmentsGroup): Promise<void>;
|
|
721
|
-
private setEntityIndex;
|
|
722
|
-
private cloneProperty;
|
|
723
|
-
private clonePropertyArray;
|
|
724
|
-
}
|
|
725
|
-
export {};
|
|
726
646
|
import * as THREE from "three";
|
|
727
647
|
export declare class MaterialsUtils {
|
|
728
648
|
static isTransparent(material: THREE.Material): boolean;
|
|
@@ -764,177 +684,348 @@ export declare class VertexPicker extends Component implements Disposable {
|
|
|
764
684
|
private getVertices;
|
|
765
685
|
private getVertex;
|
|
766
686
|
}
|
|
767
|
-
import
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
}
|
|
782
|
-
export declare const IfcElements: {
|
|
783
|
-
[key: number]: string;
|
|
784
|
-
};
|
|
785
|
-
export declare const GeometryTypes: Set<number>;
|
|
786
|
-
export declare const IfcCategoryMap: {
|
|
787
|
-
[key: number]: string;
|
|
788
|
-
};
|
|
789
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
790
|
-
export declare class IfcPropertiesUtils {
|
|
791
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
792
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
793
|
-
[attribute: string]: any;
|
|
794
|
-
} | null>;
|
|
795
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
796
|
-
[relatingID: number]: number[];
|
|
797
|
-
}>;
|
|
798
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
799
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
800
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
801
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
802
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
803
|
-
key: string | null;
|
|
804
|
-
name: string | null;
|
|
805
|
-
}>;
|
|
806
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
807
|
-
key: string | null;
|
|
808
|
-
value: number | null;
|
|
809
|
-
}>;
|
|
810
|
-
static isRel(expressID: number): boolean;
|
|
811
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
812
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
687
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
688
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
689
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
690
|
+
enabled: boolean;
|
|
691
|
+
height: number;
|
|
692
|
+
groupName: string;
|
|
693
|
+
/** {@link Disposable.onDisposed} */
|
|
694
|
+
readonly onDisposed: Event<string>;
|
|
695
|
+
list: Set<string>;
|
|
696
|
+
constructor(components: Components);
|
|
697
|
+
dispose(): void;
|
|
698
|
+
explode(): void;
|
|
699
|
+
reset(): void;
|
|
700
|
+
update(): void;
|
|
813
701
|
}
|
|
814
702
|
import * as THREE from "three";
|
|
815
|
-
import
|
|
703
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
704
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
705
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
816
706
|
/**
|
|
817
|
-
* A
|
|
818
|
-
*
|
|
819
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
820
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
707
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
708
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
821
709
|
*/
|
|
822
|
-
export declare class
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
/** {@link Disposable.onDisposed} */
|
|
827
|
-
readonly onDisposed: Event<unknown>;
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
710
|
+
export declare class FragmentBoundingBox extends Component implements Disposable {
|
|
711
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
712
|
+
/** {@link Component.enabled} */
|
|
713
|
+
enabled: boolean;
|
|
714
|
+
/** {@link Disposable.onDisposed} */
|
|
715
|
+
readonly onDisposed: Event<unknown>;
|
|
716
|
+
private _absoluteMin;
|
|
717
|
+
private _absoluteMax;
|
|
718
|
+
private _meshes;
|
|
719
|
+
constructor(components: Components);
|
|
720
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
721
|
+
width: number;
|
|
722
|
+
height: number;
|
|
723
|
+
depth: number;
|
|
724
|
+
center: THREE.Vector3;
|
|
725
|
+
};
|
|
726
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
727
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
833
728
|
/** {@link Disposable.dispose} */
|
|
834
729
|
dispose(): void;
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
730
|
+
get(): THREE.Box3;
|
|
731
|
+
getSphere(): THREE.Sphere;
|
|
732
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
733
|
+
reset(): void;
|
|
734
|
+
add(group: FragmentsGroup): void;
|
|
735
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
|
|
736
|
+
private static getFragmentBounds;
|
|
839
737
|
}
|
|
840
738
|
import * as THREE from "three";
|
|
841
|
-
import
|
|
842
|
-
import { Components } from "../../
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
739
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
740
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
741
|
+
export interface Classification {
|
|
742
|
+
[system: string]: {
|
|
743
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
export declare class FragmentClassifier extends Component implements Disposable {
|
|
747
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
848
748
|
/** {@link Component.enabled} */
|
|
849
749
|
enabled: boolean;
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
856
|
-
constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
857
|
-
/** {@link Updateable.update} */
|
|
858
|
-
update(): void;
|
|
859
|
-
/** {@link Disposable.dispose} */
|
|
750
|
+
list: Classification;
|
|
751
|
+
/** {@link Disposable.onDisposed} */
|
|
752
|
+
readonly onDisposed: Event<unknown>;
|
|
753
|
+
constructor(components: Components);
|
|
754
|
+
private onFragmentsDisposed;
|
|
860
755
|
dispose(): void;
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
756
|
+
remove(guid: string): void;
|
|
757
|
+
find(filter?: {
|
|
758
|
+
[name: string]: string[];
|
|
759
|
+
}): FRAGS.FragmentIdMap;
|
|
760
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
761
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
762
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
763
|
+
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
764
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
765
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, _override?: boolean): void;
|
|
766
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
767
|
+
private saveItem;
|
|
871
768
|
}
|
|
769
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
770
|
+
import { Components, Component } from "../../core";
|
|
771
|
+
export declare class FragmentHider extends Component {
|
|
772
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
773
|
+
enabled: boolean;
|
|
774
|
+
constructor(components: Components);
|
|
775
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
776
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
777
|
+
private updateCulledVisibility;
|
|
778
|
+
}
|
|
779
|
+
import * as WEBIFC from "web-ifc";
|
|
780
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
781
|
+
import { IfcFragmentSettings } from "./src";
|
|
782
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
783
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
784
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
785
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
786
|
+
readonly onSetup: Event<void>;
|
|
787
|
+
/** {@link Disposable.onDisposed} */
|
|
788
|
+
readonly onDisposed: Event<string>;
|
|
789
|
+
settings: IfcFragmentSettings;
|
|
790
|
+
enabled: boolean;
|
|
791
|
+
webIfc: WEBIFC.IfcAPI;
|
|
792
|
+
private _material;
|
|
793
|
+
private _spatialTree;
|
|
794
|
+
private _metaData;
|
|
795
|
+
private _fragmentInstances;
|
|
796
|
+
private _civil;
|
|
797
|
+
private _propertyExporter;
|
|
798
|
+
private _visitedFragments;
|
|
799
|
+
private _materialT;
|
|
800
|
+
constructor(components: Components);
|
|
801
|
+
dispose(): void;
|
|
802
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
803
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
804
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
805
|
+
private getAllGeometries;
|
|
806
|
+
cleanUp(): void;
|
|
807
|
+
private getMesh;
|
|
808
|
+
private getGeometry;
|
|
809
|
+
private autoSetWasm;
|
|
810
|
+
}
|
|
811
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
872
812
|
import * as THREE from "three";
|
|
873
|
-
import { Components } from "../../
|
|
874
|
-
import { Event, World, Disposable } from "../../Types";
|
|
875
|
-
import { Mouse } from "./mouse";
|
|
813
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
876
814
|
/**
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
* events.
|
|
815
|
+
* Object that can efficiently load binary files that contain
|
|
816
|
+
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
880
817
|
*/
|
|
881
|
-
export declare class
|
|
882
|
-
|
|
883
|
-
enabled: boolean;
|
|
884
|
-
components: Components;
|
|
818
|
+
export declare class FragmentManager extends Component implements Disposable {
|
|
819
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
885
820
|
/** {@link Disposable.onDisposed} */
|
|
886
821
|
readonly onDisposed: Event<unknown>;
|
|
887
|
-
|
|
888
|
-
readonly
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
822
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
823
|
+
readonly onFragmentsDisposed: Event<{
|
|
824
|
+
groupID: string;
|
|
825
|
+
fragmentIDs: string[];
|
|
826
|
+
}>;
|
|
827
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
828
|
+
readonly list: Map<string, Fragment>;
|
|
829
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
830
|
+
/** {@link Component.enabled} */
|
|
831
|
+
enabled: boolean;
|
|
832
|
+
baseCoordinationModel: string;
|
|
833
|
+
private _loader;
|
|
834
|
+
/** The list of meshes of the created fragments. */
|
|
835
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
836
|
+
constructor(components: Components);
|
|
892
837
|
/** {@link Disposable.dispose} */
|
|
893
838
|
dispose(): void;
|
|
839
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
894
840
|
/**
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
899
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
900
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
901
|
-
* {@link Components.meshes}.
|
|
841
|
+
* Loads one or many fragments into the scene.
|
|
842
|
+
* @param data - the bytes containing the data for the fragments to load.
|
|
843
|
+
* @param coordinate - whether this fragmentsgroup should be federated with the others.
|
|
844
|
+
* @returns the list of IDs of the loaded fragments.
|
|
902
845
|
*/
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
846
|
+
load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
|
|
847
|
+
/**
|
|
848
|
+
* Export the specified fragments.
|
|
849
|
+
* @param group - the fragments group to be exported.
|
|
850
|
+
* @returns the exported data as binary buffer.
|
|
851
|
+
*/
|
|
852
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
853
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
854
|
+
}
|
|
855
|
+
import * as WEBIFC from "web-ifc";
|
|
856
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
857
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
858
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
859
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
860
|
+
onGeometryStreamed: Event<{
|
|
861
|
+
buffer: Uint8Array;
|
|
862
|
+
data: StreamedGeometries;
|
|
863
|
+
}>;
|
|
864
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
865
|
+
onProgress: Event<number>;
|
|
866
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
867
|
+
/** {@link Disposable.onDisposed} */
|
|
868
|
+
readonly onDisposed: Event<unknown>;
|
|
869
|
+
settings: IfcStreamingSettings;
|
|
870
|
+
enabled: boolean;
|
|
871
|
+
webIfc: WEBIFC.IfcAPI;
|
|
872
|
+
private _spatialTree;
|
|
873
|
+
private _metaData;
|
|
874
|
+
private _visitedGeometries;
|
|
875
|
+
private _streamSerializer;
|
|
876
|
+
private _geometries;
|
|
877
|
+
private _geometryCount;
|
|
878
|
+
private _civil;
|
|
879
|
+
private _groupSerializer;
|
|
880
|
+
private _assets;
|
|
881
|
+
private _meshesWithHoles;
|
|
882
|
+
constructor(components: Components);
|
|
883
|
+
dispose(): void;
|
|
884
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
885
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
886
|
+
private readIfcFile;
|
|
887
|
+
private streamIfcFile;
|
|
888
|
+
private streamAllGeometries;
|
|
889
|
+
private cleanUp;
|
|
890
|
+
private getMesh;
|
|
891
|
+
private getGeometry;
|
|
892
|
+
private streamAssets;
|
|
893
|
+
private streamGeometries;
|
|
907
894
|
}
|
|
908
895
|
import * as THREE from "three";
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
896
|
+
export interface MeasureEdge {
|
|
897
|
+
distance: number;
|
|
898
|
+
points: THREE.Vector3[];
|
|
899
|
+
}
|
|
900
|
+
export declare class MeasurementUtils {
|
|
901
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
902
|
+
edges: MeasureEdge[];
|
|
903
|
+
indices: Set<number>;
|
|
904
|
+
} | null;
|
|
905
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
906
|
+
private static getFaceData;
|
|
907
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
908
|
+
p1: THREE.Vector3;
|
|
909
|
+
p2: THREE.Vector3;
|
|
910
|
+
p3: THREE.Vector3;
|
|
911
|
+
faceNormal: THREE.Vector3;
|
|
920
912
|
};
|
|
913
|
+
private static round;
|
|
921
914
|
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
/**
|
|
936
|
-
|
|
915
|
+
import * as WEBIFC from "web-ifc";
|
|
916
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
917
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
918
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
919
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
920
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
921
|
+
type: number;
|
|
922
|
+
data: {
|
|
923
|
+
[id: number]: any;
|
|
924
|
+
};
|
|
925
|
+
}>;
|
|
926
|
+
onProgress: AsyncEvent<number>;
|
|
927
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
928
|
+
/** {@link Disposable.onDisposed} */
|
|
929
|
+
readonly onDisposed: Event<string>;
|
|
930
|
+
enabled: boolean;
|
|
931
|
+
settings: PropertiesStreamingSettings;
|
|
932
|
+
webIfc: WEBIFC.IfcAPI;
|
|
933
|
+
dispose(): Promise<void>;
|
|
934
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
935
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
936
|
+
private readIfcFile;
|
|
937
|
+
private streamIfcFile;
|
|
938
|
+
private streamAllProperties;
|
|
939
|
+
private cleanUp;
|
|
937
940
|
}
|
|
941
|
+
import * as WEBIFC from "web-ifc";
|
|
942
|
+
export interface IfcItemsCategories {
|
|
943
|
+
[itemID: number]: number;
|
|
944
|
+
}
|
|
945
|
+
export declare class IfcCategories {
|
|
946
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
947
|
+
}
|
|
948
|
+
export declare const IfcElements: {
|
|
949
|
+
[key: number]: string;
|
|
950
|
+
};
|
|
951
|
+
export declare const IfcCategoryMap: {
|
|
952
|
+
[key: number]: string;
|
|
953
|
+
};
|
|
954
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
955
|
+
export declare class IfcPropertiesUtils {
|
|
956
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
957
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
958
|
+
[attribute: string]: any;
|
|
959
|
+
} | null>;
|
|
960
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
961
|
+
[relatingID: number]: number[];
|
|
962
|
+
}>;
|
|
963
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
964
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
965
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
966
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
967
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
968
|
+
key: string | null;
|
|
969
|
+
name: string | null;
|
|
970
|
+
}>;
|
|
971
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
972
|
+
key: string | null;
|
|
973
|
+
value: number | null;
|
|
974
|
+
}>;
|
|
975
|
+
static isRel(expressID: number): boolean;
|
|
976
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
977
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
978
|
+
}
|
|
979
|
+
export declare const GeometryTypes: Set<number>;
|
|
980
|
+
import * as THREE from "three";
|
|
981
|
+
import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
|
|
982
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
983
|
+
/** {@link Disposable.onDisposed} */
|
|
984
|
+
readonly onDisposed: Event<unknown>;
|
|
985
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
986
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
987
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
988
|
+
frontOffset: number;
|
|
989
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
990
|
+
backgroundColor: THREE.Color;
|
|
991
|
+
renderer: THREE.WebGLRenderer;
|
|
992
|
+
enabled: boolean;
|
|
993
|
+
world: World;
|
|
994
|
+
private _lockRotation;
|
|
995
|
+
private _camera;
|
|
996
|
+
private _plane;
|
|
997
|
+
private _size;
|
|
998
|
+
private _tempVector1;
|
|
999
|
+
private _tempVector2;
|
|
1000
|
+
private _tempTarget;
|
|
1001
|
+
private readonly down;
|
|
1002
|
+
get lockRotation(): boolean;
|
|
1003
|
+
set lockRotation(active: boolean);
|
|
1004
|
+
get zoom(): number;
|
|
1005
|
+
set zoom(value: number);
|
|
1006
|
+
constructor(world: World);
|
|
1007
|
+
dispose(): void;
|
|
1008
|
+
get(): THREE.OrthographicCamera;
|
|
1009
|
+
update(): void;
|
|
1010
|
+
getSize(): THREE.Vector2;
|
|
1011
|
+
resize(size?: THREE.Vector2): void;
|
|
1012
|
+
private updatePlanes;
|
|
1013
|
+
}
|
|
1014
|
+
export declare const relToAttributesMap: Map<number, {
|
|
1015
|
+
forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
1016
|
+
forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
1017
|
+
}>;
|
|
1018
|
+
import * as WEBIFC from "web-ifc";
|
|
1019
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
1020
|
+
export declare class SpatialStructure {
|
|
1021
|
+
itemsByFloor: IfcItemsCategories;
|
|
1022
|
+
private _units;
|
|
1023
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1024
|
+
cleanUp(): void;
|
|
1025
|
+
}
|
|
1026
|
+
export declare const getRelationMap: (properties: Record<string, Record<string, any>>, relationType: number, onElementsFound?: ((relatingID: number, relatedIDs: number[]) => void) | undefined) => {
|
|
1027
|
+
[relatingID: number]: number[];
|
|
1028
|
+
};
|
|
938
1029
|
/// <reference types="node" />
|
|
939
1030
|
import * as THREE from "three";
|
|
940
1031
|
import { Hideable, Event, World } from "../../Types";
|
|
@@ -984,30 +1075,66 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
984
1075
|
private updateZoom;
|
|
985
1076
|
}
|
|
986
1077
|
import * as THREE from "three";
|
|
987
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
988
1078
|
import { Components } from "../../Components";
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1079
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1080
|
+
import { Mouse } from "./mouse";
|
|
1081
|
+
/**
|
|
1082
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1083
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1084
|
+
* events.
|
|
1085
|
+
*/
|
|
1086
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1087
|
+
/** {@link Component.enabled} */
|
|
996
1088
|
enabled: boolean;
|
|
997
|
-
|
|
1089
|
+
components: Components;
|
|
1090
|
+
/** {@link Disposable.onDisposed} */
|
|
998
1091
|
readonly onDisposed: Event<unknown>;
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1092
|
+
/** The position of the mouse in the screen. */
|
|
1093
|
+
readonly mouse: Mouse;
|
|
1094
|
+
readonly three: THREE.Raycaster;
|
|
1095
|
+
world: World;
|
|
1096
|
+
constructor(components: Components, world: World);
|
|
1097
|
+
/** {@link Disposable.dispose} */
|
|
1098
|
+
dispose(): void;
|
|
1099
|
+
/**
|
|
1100
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1101
|
+
* the first item found. This also takes into account the clipping planes
|
|
1102
|
+
* used by the renderer.
|
|
1103
|
+
*
|
|
1104
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1105
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1106
|
+
* {@link Components.meshes}.
|
|
1107
|
+
*/
|
|
1108
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1109
|
+
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;
|
|
1110
|
+
private intersect;
|
|
1111
|
+
private filterClippingPlanes;
|
|
1112
|
+
}
|
|
1113
|
+
import * as THREE from "three";
|
|
1114
|
+
import { Disposable, Event } from "../../Types";
|
|
1115
|
+
/**
|
|
1116
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1117
|
+
* to work with tools like the
|
|
1118
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1119
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1120
|
+
*/
|
|
1121
|
+
export declare class Mouse implements Disposable {
|
|
1122
|
+
dom: HTMLCanvasElement;
|
|
1123
|
+
private _event?;
|
|
1124
|
+
private _position;
|
|
1125
|
+
/** {@link Disposable.onDisposed} */
|
|
1126
|
+
readonly onDisposed: Event<unknown>;
|
|
1127
|
+
constructor(dom: HTMLCanvasElement);
|
|
1128
|
+
/**
|
|
1129
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1130
|
+
*/
|
|
1131
|
+
get position(): THREE.Vector2;
|
|
1132
|
+
/** {@link Disposable.dispose} */
|
|
1133
|
+
dispose(): void;
|
|
1134
|
+
private getPositionY;
|
|
1135
|
+
private getPositionX;
|
|
1136
|
+
private updateMouseInfo;
|
|
1137
|
+
private setupEvents;
|
|
1011
1138
|
}
|
|
1012
1139
|
/**
|
|
1013
1140
|
* Simple event handler by
|
|
@@ -1218,51 +1345,52 @@ export declare abstract class Component extends Base {
|
|
|
1218
1345
|
*/
|
|
1219
1346
|
abstract enabled: boolean;
|
|
1220
1347
|
}
|
|
1221
|
-
import
|
|
1222
|
-
import CameraControls from "camera-controls";
|
|
1223
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1348
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1224
1349
|
import { Components } from "../../Components";
|
|
1225
1350
|
/**
|
|
1226
|
-
*
|
|
1227
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1228
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1229
|
-
* what features it offers.
|
|
1351
|
+
* Base class of the library. Useful for finding out the interfaces it implements.
|
|
1230
1352
|
*/
|
|
1231
|
-
export declare class
|
|
1232
|
-
|
|
1233
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1234
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1235
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1236
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
1237
|
-
/** {@link Disposable.onDisposed} */
|
|
1238
|
-
readonly onDisposed: Event<string>;
|
|
1239
|
-
readonly three: THREE.PerspectiveCamera;
|
|
1240
|
-
private _allControls;
|
|
1241
|
-
/**
|
|
1242
|
-
* The object that controls the camera. An instance of
|
|
1243
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1244
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
1245
|
-
* object to move, rotate, look at objects, etc.
|
|
1246
|
-
*/
|
|
1247
|
-
get controls(): CameraControls;
|
|
1248
|
-
/** {@link Component.enabled} */
|
|
1249
|
-
get enabled(): boolean;
|
|
1250
|
-
/** {@link Component.enabled} */
|
|
1251
|
-
set enabled(enabled: boolean);
|
|
1353
|
+
export declare abstract class Base {
|
|
1354
|
+
components: Components;
|
|
1252
1355
|
constructor(components: Components);
|
|
1253
|
-
/** {@link Disposable.
|
|
1254
|
-
|
|
1255
|
-
/** {@link
|
|
1256
|
-
|
|
1257
|
-
/**
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1356
|
+
/** Whether is component is {@link Disposable}. */
|
|
1357
|
+
isDisposeable: () => this is Disposable;
|
|
1358
|
+
/** Whether is component is {@link Resizeable}. */
|
|
1359
|
+
isResizeable: () => this is Resizeable;
|
|
1360
|
+
/** Whether is component is {@link Updateable}. */
|
|
1361
|
+
isUpdateable: () => this is Updateable;
|
|
1362
|
+
/** Whether is component is {@link Hideable}. */
|
|
1363
|
+
isHideable: () => this is Hideable;
|
|
1364
|
+
/** Whether is component is {@link Configurable}. */
|
|
1365
|
+
isConfigurable: () => this is Configurable<any>;
|
|
1366
|
+
}
|
|
1367
|
+
import { Base } from "./base";
|
|
1368
|
+
import { World } from "./world";
|
|
1369
|
+
import { Event } from "./event";
|
|
1370
|
+
import { Components } from "../../Components";
|
|
1371
|
+
/**
|
|
1372
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1373
|
+
* or a renderer.
|
|
1374
|
+
*/
|
|
1375
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1376
|
+
readonly worlds: Map<string, World>;
|
|
1377
|
+
readonly onWorldChanged: Event<{
|
|
1378
|
+
world: World;
|
|
1379
|
+
action: "added" | "removed";
|
|
1380
|
+
}>;
|
|
1381
|
+
currentWorld: World | null;
|
|
1382
|
+
protected constructor(components: Components);
|
|
1383
|
+
}
|
|
1384
|
+
import * as THREE from "three";
|
|
1385
|
+
import CameraControls from "camera-controls";
|
|
1386
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1387
|
+
import { CameraControllable } from "./interfaces";
|
|
1388
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1389
|
+
abstract enabled: boolean;
|
|
1390
|
+
abstract three: THREE.Camera;
|
|
1391
|
+
abstract controls?: CameraControls;
|
|
1392
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1393
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1266
1394
|
}
|
|
1267
1395
|
import * as THREE from "three";
|
|
1268
1396
|
import { Vector2 } from "three";
|
|
@@ -1305,32 +1433,17 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1305
1433
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1306
1434
|
}
|
|
1307
1435
|
import * as THREE from "three";
|
|
1308
|
-
import
|
|
1309
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
1310
|
-
import { CameraControllable } from "./interfaces";
|
|
1311
|
-
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1312
|
-
abstract enabled: boolean;
|
|
1313
|
-
abstract three: THREE.Camera;
|
|
1314
|
-
abstract controls?: CameraControls;
|
|
1315
|
-
/** Whether is instance is {@link CameraControllable}. */
|
|
1316
|
-
hasCameraControls: () => this is CameraControllable;
|
|
1317
|
-
}
|
|
1318
|
-
import { Base } from "./base";
|
|
1319
|
-
import { World } from "./world";
|
|
1436
|
+
import { Disposable } from "./interfaces";
|
|
1320
1437
|
import { Event } from "./event";
|
|
1321
1438
|
import { Components } from "../../Components";
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
readonly worlds: Map<string, World>;
|
|
1328
|
-
readonly onWorldChanged: Event<{
|
|
1329
|
-
world: World;
|
|
1330
|
-
action: "added" | "removed";
|
|
1331
|
-
}>;
|
|
1332
|
-
currentWorld: World | null;
|
|
1439
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1440
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1441
|
+
/** {@link Disposable.onDisposed} */
|
|
1442
|
+
readonly onDisposed: Event<unknown>;
|
|
1443
|
+
abstract three: THREE.Object3D;
|
|
1333
1444
|
protected constructor(components: Components);
|
|
1445
|
+
/** {@link Disposable.dispose} */
|
|
1446
|
+
dispose(): void;
|
|
1334
1447
|
}
|
|
1335
1448
|
import * as THREE from "three";
|
|
1336
1449
|
import { BaseScene } from "./base-scene";
|
|
@@ -1344,37 +1457,138 @@ export interface World extends Disposable, Updateable {
|
|
|
1344
1457
|
renderer: BaseRenderer | null;
|
|
1345
1458
|
uuid: string;
|
|
1346
1459
|
}
|
|
1347
|
-
import
|
|
1460
|
+
import * as THREE from "three";
|
|
1461
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1462
|
+
import { Components } from "../../Components";
|
|
1463
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1464
|
+
/**
|
|
1465
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1466
|
+
*/
|
|
1467
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1468
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1469
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1470
|
+
enabled: boolean;
|
|
1471
|
+
uuid: string;
|
|
1472
|
+
readonly onDisposed: Event<unknown>;
|
|
1473
|
+
private _scene?;
|
|
1474
|
+
private _camera?;
|
|
1475
|
+
private _renderer;
|
|
1476
|
+
get scene(): T;
|
|
1477
|
+
set scene(scene: T);
|
|
1478
|
+
get camera(): U;
|
|
1479
|
+
set camera(camera: U);
|
|
1480
|
+
get renderer(): S | null;
|
|
1481
|
+
set renderer(renderer: S | null);
|
|
1482
|
+
constructor(components: Components);
|
|
1483
|
+
update(delta?: number): void;
|
|
1484
|
+
dispose(disposeResources?: boolean): void;
|
|
1485
|
+
}
|
|
1486
|
+
import * as THREE from "three";
|
|
1487
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1348
1488
|
import { Components } from "../../Components";
|
|
1489
|
+
export interface SimpleSceneConfig {
|
|
1490
|
+
directionalLight: {
|
|
1491
|
+
color: THREE.Color;
|
|
1492
|
+
intensity: number;
|
|
1493
|
+
position: THREE.Vector3;
|
|
1494
|
+
};
|
|
1495
|
+
ambientLight: {
|
|
1496
|
+
color: THREE.Color;
|
|
1497
|
+
intensity: number;
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1349
1500
|
/**
|
|
1350
|
-
*
|
|
1501
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1502
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1503
|
+
* @noInheritDoc
|
|
1351
1504
|
*/
|
|
1352
|
-
export declare
|
|
1353
|
-
|
|
1505
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1506
|
+
/** {@link Configurable.isSetup} */
|
|
1507
|
+
isSetup: boolean;
|
|
1508
|
+
three: THREE.Scene;
|
|
1509
|
+
/** {@link Configurable.onSetup} */
|
|
1510
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1511
|
+
config: Required<SimpleSceneConfig>;
|
|
1354
1512
|
constructor(components: Components);
|
|
1355
|
-
/**
|
|
1356
|
-
|
|
1357
|
-
/** Whether is component is {@link Resizeable}. */
|
|
1358
|
-
isResizeable: () => this is Resizeable;
|
|
1359
|
-
/** Whether is component is {@link Updateable}. */
|
|
1360
|
-
isUpdateable: () => this is Updateable;
|
|
1361
|
-
/** Whether is component is {@link Hideable}. */
|
|
1362
|
-
isHideable: () => this is Hideable;
|
|
1363
|
-
/** Whether is component is {@link Configurable}. */
|
|
1364
|
-
isConfigurable: () => this is Configurable<any>;
|
|
1513
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1514
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1365
1515
|
}
|
|
1366
1516
|
import * as THREE from "three";
|
|
1367
|
-
import {
|
|
1368
|
-
import { Event } from "./event";
|
|
1517
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1369
1518
|
import { Components } from "../../Components";
|
|
1370
|
-
|
|
1371
|
-
|
|
1519
|
+
/**
|
|
1520
|
+
* A basic renderer capable of rendering
|
|
1521
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1522
|
+
*/
|
|
1523
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1524
|
+
enabled: boolean;
|
|
1525
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1526
|
+
container: HTMLElement;
|
|
1527
|
+
three: THREE.WebGLRenderer;
|
|
1528
|
+
protected _canvas: HTMLCanvasElement;
|
|
1529
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1530
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1531
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1532
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1533
|
+
/** {@link Updateable.update} */
|
|
1534
|
+
update(): void;
|
|
1535
|
+
/** {@link Disposable.dispose} */
|
|
1536
|
+
dispose(): void;
|
|
1537
|
+
/** {@link Resizeable.getSize}. */
|
|
1538
|
+
getSize(): THREE.Vector2;
|
|
1539
|
+
/** {@link Resizeable.resize} */
|
|
1540
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1541
|
+
setupEvents(active: boolean): void;
|
|
1542
|
+
private resizeEvent;
|
|
1543
|
+
private setupRenderer;
|
|
1544
|
+
private onContextLost;
|
|
1545
|
+
private onContextBack;
|
|
1546
|
+
}
|
|
1547
|
+
import * as THREE from "three";
|
|
1548
|
+
import CameraControls from "camera-controls";
|
|
1549
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1550
|
+
import { Components } from "../../Components";
|
|
1551
|
+
/**
|
|
1552
|
+
* A basic camera that uses
|
|
1553
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1554
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1555
|
+
* what features it offers.
|
|
1556
|
+
*/
|
|
1557
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1558
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1559
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1560
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1561
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1562
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1372
1563
|
/** {@link Disposable.onDisposed} */
|
|
1373
|
-
readonly onDisposed: Event<
|
|
1374
|
-
|
|
1375
|
-
|
|
1564
|
+
readonly onDisposed: Event<string>;
|
|
1565
|
+
readonly three: THREE.PerspectiveCamera;
|
|
1566
|
+
private _allControls;
|
|
1567
|
+
/**
|
|
1568
|
+
* The object that controls the camera. An instance of
|
|
1569
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1570
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1571
|
+
* object to move, rotate, look at objects, etc.
|
|
1572
|
+
*/
|
|
1573
|
+
get controls(): CameraControls;
|
|
1574
|
+
/** {@link Component.enabled} */
|
|
1575
|
+
get enabled(): boolean;
|
|
1576
|
+
/** {@link Component.enabled} */
|
|
1577
|
+
set enabled(enabled: boolean);
|
|
1578
|
+
constructor(components: Components);
|
|
1376
1579
|
/** {@link Disposable.dispose} */
|
|
1377
1580
|
dispose(): void;
|
|
1581
|
+
/** {@link Updateable.update} */
|
|
1582
|
+
update(_delta: number): void;
|
|
1583
|
+
/**
|
|
1584
|
+
* Updates the aspect of the camera to match the size of the
|
|
1585
|
+
* {@link Components.renderer}.
|
|
1586
|
+
*/
|
|
1587
|
+
updateAspect: () => void;
|
|
1588
|
+
private setupCamera;
|
|
1589
|
+
private newCameraControls;
|
|
1590
|
+
private setupEvents;
|
|
1591
|
+
private static getSubsetOfThree;
|
|
1378
1592
|
}
|
|
1379
1593
|
import * as THREE from "three";
|
|
1380
1594
|
import { Components } from "../../Components";
|
|
@@ -1444,6 +1658,35 @@ export declare class CullerRenderer {
|
|
|
1444
1658
|
private applySettings;
|
|
1445
1659
|
}
|
|
1446
1660
|
import * as THREE from "three";
|
|
1661
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1662
|
+
import { Components } from "../../Components";
|
|
1663
|
+
import { Event, World } from "../../Types";
|
|
1664
|
+
/**
|
|
1665
|
+
* A renderer to determine a mesh visibility on screen
|
|
1666
|
+
*/
|
|
1667
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1668
|
+
threshold: number;
|
|
1669
|
+
readonly onViewUpdated: Event<{
|
|
1670
|
+
seen: Set<THREE.Mesh>;
|
|
1671
|
+
unseen: Set<THREE.Mesh>;
|
|
1672
|
+
}>;
|
|
1673
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1674
|
+
isProcessing: boolean;
|
|
1675
|
+
private _colorCodeMeshMap;
|
|
1676
|
+
private _meshIDColorCodeMap;
|
|
1677
|
+
private _currentVisibleMeshes;
|
|
1678
|
+
private _recentlyHiddenMeshes;
|
|
1679
|
+
private _intervalID;
|
|
1680
|
+
private readonly _transparentMat;
|
|
1681
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1682
|
+
dispose(): void;
|
|
1683
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1684
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1685
|
+
private handleWorkerMessage;
|
|
1686
|
+
private getAvailableMaterial;
|
|
1687
|
+
}
|
|
1688
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1689
|
+
import * as THREE from "three";
|
|
1447
1690
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1448
1691
|
import { Components } from "../../Components";
|
|
1449
1692
|
/**
|
|
@@ -1504,35 +1747,6 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1504
1747
|
private newHelper;
|
|
1505
1748
|
private static newPlaneMesh;
|
|
1506
1749
|
}
|
|
1507
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1508
|
-
import * as THREE from "three";
|
|
1509
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1510
|
-
import { Components } from "../../Components";
|
|
1511
|
-
import { Event, World } from "../../Types";
|
|
1512
|
-
/**
|
|
1513
|
-
* A renderer to determine a mesh visibility on screen
|
|
1514
|
-
*/
|
|
1515
|
-
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1516
|
-
threshold: number;
|
|
1517
|
-
readonly onViewUpdated: Event<{
|
|
1518
|
-
seen: Set<THREE.Mesh>;
|
|
1519
|
-
unseen: Set<THREE.Mesh>;
|
|
1520
|
-
}>;
|
|
1521
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1522
|
-
isProcessing: boolean;
|
|
1523
|
-
private _colorCodeMeshMap;
|
|
1524
|
-
private _meshIDColorCodeMap;
|
|
1525
|
-
private _currentVisibleMeshes;
|
|
1526
|
-
private _recentlyHiddenMeshes;
|
|
1527
|
-
private _intervalID;
|
|
1528
|
-
private readonly _transparentMat;
|
|
1529
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1530
|
-
dispose(): void;
|
|
1531
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1532
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1533
|
-
private handleWorkerMessage;
|
|
1534
|
-
private getAvailableMaterial;
|
|
1535
|
-
}
|
|
1536
1750
|
import { NavigationMode } from "./types";
|
|
1537
1751
|
/**
|
|
1538
1752
|
* A {@link NavigationMode} that allows first person navigation,
|
|
@@ -1565,6 +1779,26 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
1565
1779
|
set(active: boolean): void;
|
|
1566
1780
|
private activateOrbitControls;
|
|
1567
1781
|
}
|
|
1782
|
+
import { NavigationMode } from "./types";
|
|
1783
|
+
/**
|
|
1784
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1785
|
+
* like many BIM tools.
|
|
1786
|
+
*/
|
|
1787
|
+
export declare class PlanMode implements NavigationMode {
|
|
1788
|
+
private camera;
|
|
1789
|
+
/** {@link NavigationMode.enabled} */
|
|
1790
|
+
enabled: boolean;
|
|
1791
|
+
/** {@link NavigationMode.id} */
|
|
1792
|
+
readonly id = "Plan";
|
|
1793
|
+
private mouseAction1?;
|
|
1794
|
+
private mouseAction2?;
|
|
1795
|
+
private mouseInitialized;
|
|
1796
|
+
private readonly defaultAzimuthSpeed;
|
|
1797
|
+
private readonly defaultPolarSpeed;
|
|
1798
|
+
constructor(camera: any);
|
|
1799
|
+
/** {@link NavigationMode.set} */
|
|
1800
|
+
set(active: boolean): void;
|
|
1801
|
+
}
|
|
1568
1802
|
import * as THREE from "three";
|
|
1569
1803
|
import { CameraProjection } from "./types";
|
|
1570
1804
|
import { Event } from "../../../core";
|
|
@@ -1602,36 +1836,6 @@ export declare class ProjectionManager {
|
|
|
1602
1836
|
private getDistance;
|
|
1603
1837
|
private setPerspectiveCamera;
|
|
1604
1838
|
}
|
|
1605
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1606
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1607
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1608
|
-
minGeometrySize: number;
|
|
1609
|
-
minAssetsSize: number;
|
|
1610
|
-
}
|
|
1611
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1612
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1613
|
-
propertiesSize: number;
|
|
1614
|
-
}
|
|
1615
|
-
import { NavigationMode } from "./types";
|
|
1616
|
-
/**
|
|
1617
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1618
|
-
* like many BIM tools.
|
|
1619
|
-
*/
|
|
1620
|
-
export declare class PlanMode implements NavigationMode {
|
|
1621
|
-
private camera;
|
|
1622
|
-
/** {@link NavigationMode.enabled} */
|
|
1623
|
-
enabled: boolean;
|
|
1624
|
-
/** {@link NavigationMode.id} */
|
|
1625
|
-
readonly id = "Plan";
|
|
1626
|
-
private mouseAction1?;
|
|
1627
|
-
private mouseAction2?;
|
|
1628
|
-
private mouseInitialized;
|
|
1629
|
-
private readonly defaultAzimuthSpeed;
|
|
1630
|
-
private readonly defaultPolarSpeed;
|
|
1631
|
-
constructor(camera: any);
|
|
1632
|
-
/** {@link NavigationMode.set} */
|
|
1633
|
-
set(active: boolean): void;
|
|
1634
|
-
}
|
|
1635
1839
|
/**
|
|
1636
1840
|
* The projection system of the camera.
|
|
1637
1841
|
*/
|
|
@@ -1659,19 +1863,29 @@ export interface NavigationMode {
|
|
|
1659
1863
|
/** Whether this navigation mode is active or not. */
|
|
1660
1864
|
enabled: boolean;
|
|
1661
1865
|
}
|
|
1866
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1867
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1868
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1869
|
+
minGeometrySize: number;
|
|
1870
|
+
minAssetsSize: number;
|
|
1871
|
+
}
|
|
1872
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1873
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1874
|
+
propertiesSize: number;
|
|
1875
|
+
}
|
|
1662
1876
|
import * as WEBIFC from "web-ifc";
|
|
1663
|
-
import { Component, Disposable, Event } from "../../../core";
|
|
1877
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1664
1878
|
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1665
1879
|
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1666
1880
|
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1667
|
-
onPropertiesStreamed:
|
|
1881
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1668
1882
|
type: number;
|
|
1669
1883
|
data: {
|
|
1670
1884
|
[id: number]: any;
|
|
1671
1885
|
};
|
|
1672
1886
|
}>;
|
|
1673
|
-
onProgress:
|
|
1674
|
-
onIndicesStreamed:
|
|
1887
|
+
onProgress: AsyncEvent<number>;
|
|
1888
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1675
1889
|
/** {@link Disposable.onDisposed} */
|
|
1676
1890
|
readonly onDisposed: Event<string>;
|
|
1677
1891
|
enabled: boolean;
|
|
@@ -1686,47 +1900,6 @@ export declare class FragmentPropsStreamConverter extends Component implements D
|
|
|
1686
1900
|
private getIndices;
|
|
1687
1901
|
private cleanUp;
|
|
1688
1902
|
}
|
|
1689
|
-
import * as WEBIFC from "web-ifc";
|
|
1690
|
-
import { Components, Disposable, Event, Component } from "../../../core";
|
|
1691
|
-
import { IfcStreamingSettings } from "./streaming-settings";
|
|
1692
|
-
import { StreamedGeometries, StreamedAsset } from "./base-types";
|
|
1693
|
-
export declare class FragmentIfcStreamConverter extends Component implements Disposable {
|
|
1694
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1695
|
-
onGeometryStreamed: Event<{
|
|
1696
|
-
buffer: Uint8Array;
|
|
1697
|
-
data: StreamedGeometries;
|
|
1698
|
-
}>;
|
|
1699
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1700
|
-
onProgress: Event<number>;
|
|
1701
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
1702
|
-
/** {@link Disposable.onDisposed} */
|
|
1703
|
-
readonly onDisposed: Event<unknown>;
|
|
1704
|
-
settings: IfcStreamingSettings;
|
|
1705
|
-
enabled: boolean;
|
|
1706
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1707
|
-
private _spatialTree;
|
|
1708
|
-
private _metaData;
|
|
1709
|
-
private _visitedGeometries;
|
|
1710
|
-
private _streamSerializer;
|
|
1711
|
-
private _geometries;
|
|
1712
|
-
private _geometryCount;
|
|
1713
|
-
private _civil;
|
|
1714
|
-
private _groupSerializer;
|
|
1715
|
-
private _assets;
|
|
1716
|
-
private _meshesWithHoles;
|
|
1717
|
-
constructor(components: Components);
|
|
1718
|
-
dispose(): void;
|
|
1719
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1720
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1721
|
-
private readIfcFile;
|
|
1722
|
-
private streamIfcFile;
|
|
1723
|
-
private streamAllGeometries;
|
|
1724
|
-
private cleanUp;
|
|
1725
|
-
private getMesh;
|
|
1726
|
-
private getGeometry;
|
|
1727
|
-
private streamAssets;
|
|
1728
|
-
private streamGeometries;
|
|
1729
|
-
}
|
|
1730
1903
|
export interface StreamedGeometries {
|
|
1731
1904
|
[id: number]: {
|
|
1732
1905
|
boundingBox: Float32Array;
|
|
@@ -1742,21 +1915,6 @@ export interface StreamedAsset {
|
|
|
1742
1915
|
color: number[];
|
|
1743
1916
|
}[];
|
|
1744
1917
|
}
|
|
1745
|
-
import * as THREE from "three";
|
|
1746
|
-
import * as WEBIFC from "web-ifc";
|
|
1747
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1748
|
-
export declare class CivilReader {
|
|
1749
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1750
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1751
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1752
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1753
|
-
} | undefined;
|
|
1754
|
-
get(civilItems: any): {
|
|
1755
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1756
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1757
|
-
} | undefined;
|
|
1758
|
-
private getCurves;
|
|
1759
|
-
}
|
|
1760
1918
|
import * as WEBIFC from "web-ifc";
|
|
1761
1919
|
/** Configuration of the IFC-fragment conversion. */
|
|
1762
1920
|
export declare class IfcFragmentSettings {
|
|
@@ -1784,6 +1942,21 @@ export declare class IfcFragmentSettings {
|
|
|
1784
1942
|
autoSetWasm: boolean;
|
|
1785
1943
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1786
1944
|
}
|
|
1945
|
+
import * as THREE from "three";
|
|
1946
|
+
import * as WEBIFC from "web-ifc";
|
|
1947
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1948
|
+
export declare class CivilReader {
|
|
1949
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1950
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1951
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1952
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1953
|
+
} | undefined;
|
|
1954
|
+
get(civilItems: any): {
|
|
1955
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1956
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1957
|
+
} | undefined;
|
|
1958
|
+
private getCurves;
|
|
1959
|
+
}
|
|
1787
1960
|
import * as WEBIFC from "web-ifc";
|
|
1788
1961
|
export declare class IfcMetadataReader {
|
|
1789
1962
|
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
@@ -1798,6 +1971,30 @@ export declare class Units {
|
|
|
1798
1971
|
private getLengthUnits;
|
|
1799
1972
|
private getScaleMatrix;
|
|
1800
1973
|
}
|
|
1974
|
+
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1975
|
+
export interface ModelsRelationMap {
|
|
1976
|
+
[modelID: string]: RelationsMap;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Type alias for an array of inverse attribute names.
|
|
1980
|
+
*/
|
|
1981
|
+
export type InverseAttributes = [
|
|
1982
|
+
"IsDecomposedBy",
|
|
1983
|
+
"Decomposes",
|
|
1984
|
+
"AssociatedTo",
|
|
1985
|
+
"HasAssociations",
|
|
1986
|
+
"ClassificationForObjects",
|
|
1987
|
+
"IsGroupedBy",
|
|
1988
|
+
"HasAssignments",
|
|
1989
|
+
"IsDefinedBy",
|
|
1990
|
+
"DefinesOcurrence",
|
|
1991
|
+
"IsTypedBy",
|
|
1992
|
+
"Types",
|
|
1993
|
+
"Defines",
|
|
1994
|
+
"ContainedInStructure",
|
|
1995
|
+
"ContainsElements"
|
|
1996
|
+
];
|
|
1997
|
+
export type InverseAttribute = InverseAttributes[number];
|
|
1801
1998
|
import { BufferGeometry } from "three";
|
|
1802
1999
|
import * as THREE from "three";
|
|
1803
2000
|
export declare class TransformHelper {
|
|
@@ -1826,54 +2023,5 @@ export interface Query {
|
|
|
1826
2023
|
description?: string;
|
|
1827
2024
|
groups: QueryGroup;
|
|
1828
2025
|
}
|
|
1829
|
-
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
1830
|
-
import { MiniMap } from "./src";
|
|
1831
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
1832
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
1833
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1834
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1835
|
-
readonly onDisposed: Event<unknown>;
|
|
1836
|
-
enabled: boolean;
|
|
1837
|
-
list: Map<string, MiniMap>;
|
|
1838
|
-
constructor(components: Components);
|
|
1839
|
-
create(world: World): MiniMap;
|
|
1840
|
-
delete(id: string): void;
|
|
1841
|
-
dispose(): void | Promise<void>;
|
|
1842
|
-
update(): void;
|
|
1843
|
-
}
|
|
1844
|
-
import * as THREE from "three";
|
|
1845
|
-
import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
|
|
1846
|
-
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
1847
|
-
/** {@link Disposable.onDisposed} */
|
|
1848
|
-
readonly onDisposed: Event<unknown>;
|
|
1849
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1850
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1851
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
1852
|
-
frontOffset: number;
|
|
1853
|
-
overrideMaterial: THREE.MeshDepthMaterial;
|
|
1854
|
-
backgroundColor: THREE.Color;
|
|
1855
|
-
renderer: THREE.WebGLRenderer;
|
|
1856
|
-
enabled: boolean;
|
|
1857
|
-
world: World;
|
|
1858
|
-
private _lockRotation;
|
|
1859
|
-
private _camera;
|
|
1860
|
-
private _plane;
|
|
1861
|
-
private _size;
|
|
1862
|
-
private _tempVector1;
|
|
1863
|
-
private _tempVector2;
|
|
1864
|
-
private _tempTarget;
|
|
1865
|
-
private readonly down;
|
|
1866
|
-
get lockRotation(): boolean;
|
|
1867
|
-
set lockRotation(active: boolean);
|
|
1868
|
-
get zoom(): number;
|
|
1869
|
-
set zoom(value: number);
|
|
1870
|
-
constructor(world: World);
|
|
1871
|
-
dispose(): void;
|
|
1872
|
-
get(): THREE.OrthographicCamera;
|
|
1873
|
-
update(): void;
|
|
1874
|
-
getSize(): THREE.Vector2;
|
|
1875
|
-
resize(size?: THREE.Vector2): void;
|
|
1876
|
-
private updatePlanes;
|
|
1877
|
-
}
|
|
1878
2026
|
|
|
1879
2027
|
}
|