@thatopen/components 2.0.6 → 2.0.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.
@@ -1,337 +1,4 @@
1
1
  declare namespace OBC {
2
- import { Component, Disposable, Event, Components } from "../../core";
3
- export declare class Exploder extends Component implements Disposable {
4
- static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
5
- enabled: boolean;
6
- height: number;
7
- groupName: string;
8
- /** {@link Disposable.onDisposed} */
9
- readonly onDisposed: Event<unknown>;
10
- list: Set<string>;
11
- constructor(components: Components);
12
- dispose(): void;
13
- set(active: boolean): void;
14
- }
15
- import * as THREE from "three";
16
- import * as FRAGS from "@thatopen/fragments";
17
- import { FragmentsGroup } from "@thatopen/fragments";
18
- import { Component, Components, Disposable, Event } from "../../core";
19
- /**
20
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
21
- * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
22
- */
23
- export declare class BoundingBoxer extends Component implements Disposable {
24
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
25
- /** {@link Component.enabled} */
26
- enabled: boolean;
27
- /** {@link Disposable.onDisposed} */
28
- readonly onDisposed: Event<unknown>;
29
- private _absoluteMin;
30
- private _absoluteMax;
31
- private _meshes;
32
- constructor(components: Components);
33
- static getDimensions(bbox: THREE.Box3): {
34
- width: number;
35
- height: number;
36
- depth: number;
37
- center: THREE.Vector3;
38
- };
39
- static newBound(positive: boolean): THREE.Vector3;
40
- static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
41
- /** {@link Disposable.dispose} */
42
- dispose(): void;
43
- get(): THREE.Box3;
44
- getSphere(): THREE.Sphere;
45
- getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
46
- reset(): void;
47
- add(group: FragmentsGroup): void;
48
- addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
49
- private static getFragmentBounds;
50
- }
51
- import * as THREE from "three";
52
- import * as FRAGS from "@thatopen/fragments";
53
- import { Disposable, Component, Event, Components } from "../../core";
54
- export interface Classification {
55
- [system: string]: {
56
- [className: string]: FRAGS.FragmentIdMap;
57
- };
58
- }
59
- export declare class Classifier extends Component implements Disposable {
60
- static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
61
- /** {@link Component.enabled} */
62
- enabled: boolean;
63
- list: Classification;
64
- /** {@link Disposable.onDisposed} */
65
- readonly onDisposed: Event<unknown>;
66
- constructor(components: Components);
67
- private onFragmentsDisposed;
68
- dispose(): void;
69
- remove(guid: string): void;
70
- find(filter?: {
71
- [name: string]: string[];
72
- }): FRAGS.FragmentIdMap;
73
- byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
74
- byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
75
- byEntity(group: FRAGS.FragmentsGroup): void;
76
- byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
77
- bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
78
- setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
79
- resetColor(items: FRAGS.FragmentIdMap): void;
80
- protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
81
- }
82
- import * as FRAGS from "@thatopen/fragments";
83
- import { Components, Component } from "../../core";
84
- export declare class Hider extends Component {
85
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
86
- enabled: boolean;
87
- constructor(components: Components);
88
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
89
- isolate(items: FRAGS.FragmentIdMap): void;
90
- private updateCulledVisibility;
91
- }
92
- import * as WEBIFC from "web-ifc";
93
- import { Components, Disposable, Event, Component } from "../../core";
94
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
95
- export declare class IfcGeometryTiler extends Component implements Disposable {
96
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
97
- onGeometryStreamed: Event<{
98
- buffer: Uint8Array;
99
- data: StreamedGeometries;
100
- }>;
101
- onAssetStreamed: Event<StreamedAsset[]>;
102
- onProgress: Event<number>;
103
- onIfcLoaded: Event<Uint8Array>;
104
- /** {@link Disposable.onDisposed} */
105
- readonly onDisposed: Event<unknown>;
106
- settings: IfcStreamingSettings;
107
- enabled: boolean;
108
- webIfc: WEBIFC.IfcAPI;
109
- private _spatialTree;
110
- private _metaData;
111
- private _visitedGeometries;
112
- private _streamSerializer;
113
- private _geometries;
114
- private _geometryCount;
115
- private _civil;
116
- private _groupSerializer;
117
- private _assets;
118
- private _meshesWithHoles;
119
- constructor(components: Components);
120
- dispose(): void;
121
- streamFromBuffer(data: Uint8Array): Promise<void>;
122
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
123
- private readIfcFile;
124
- private streamIfcFile;
125
- private streamAllGeometries;
126
- private cleanUp;
127
- private getMesh;
128
- private getGeometry;
129
- private streamAssets;
130
- private streamGeometries;
131
- }
132
- import { Fragment, FragmentsGroup } from "@thatopen/fragments";
133
- import * as THREE from "three";
134
- import * as FRAGS from "@thatopen/fragments";
135
- import { Component, Components, Event, Disposable } from "../../core";
136
- import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
137
- /**
138
- * Object that can efficiently load binary files that contain
139
- * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
140
- */
141
- export declare class FragmentsManager extends Component implements Disposable {
142
- static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
143
- /** {@link Disposable.onDisposed} */
144
- readonly onDisposed: Event<unknown>;
145
- readonly onFragmentsLoaded: Event<FragmentsGroup>;
146
- readonly onFragmentsDisposed: Event<{
147
- groupID: string;
148
- fragmentIDs: string[];
149
- }>;
150
- /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
151
- readonly list: Map<string, Fragment>;
152
- readonly groups: Map<string, FragmentsGroup>;
153
- /** {@link Component.enabled} */
154
- enabled: boolean;
155
- baseCoordinationModel: string;
156
- private _loader;
157
- /** The list of meshes of the created fragments. */
158
- get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
159
- constructor(components: Components);
160
- /** {@link Disposable.dispose} */
161
- dispose(): void;
162
- disposeGroup(group: FragmentsGroup): void;
163
- /**
164
- * Loads a binar file that contain fragment geometry.
165
- * @param data - The binary data to load.
166
- * @param config - Optional configuration for loading.
167
- * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
168
- * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
169
- * @returns The loaded FragmentsGroup.
170
- */
171
- load(data: Uint8Array, config?: Partial<{
172
- coordinate: boolean;
173
- name: string;
174
- properties: FRAGS.IfcProperties;
175
- relationsMap: RelationsMap;
176
- }>): FragmentsGroup;
177
- /**
178
- * Export the specified fragments.
179
- * @param group - the fragments group to be exported.
180
- * @returns the exported data as binary buffer.
181
- */
182
- export(group: FragmentsGroup): Uint8Array;
183
- coordinate(models?: FragmentsGroup[]): void;
184
- }
185
- import * as WEBIFC from "web-ifc";
186
- import * as FRAGS from "@thatopen/fragments";
187
- import { IfcFragmentSettings } from "./src";
188
- import { Component, Components, Event, Disposable } from "../../core";
189
- export declare class IfcLoader extends Component implements Disposable {
190
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
191
- readonly onIfcStartedLoading: Event<void>;
192
- readonly onSetup: Event<void>;
193
- /** {@link Disposable.onDisposed} */
194
- readonly onDisposed: Event<string>;
195
- settings: IfcFragmentSettings;
196
- enabled: boolean;
197
- webIfc: WEBIFC.IfcAPI;
198
- private _material;
199
- private _spatialTree;
200
- private _metaData;
201
- private _fragmentInstances;
202
- private _civil;
203
- private _visitedFragments;
204
- private _materialT;
205
- constructor(components: Components);
206
- dispose(): void;
207
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
208
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
209
- readIfcFile(data: Uint8Array): Promise<number>;
210
- private getAllGeometries;
211
- cleanUp(): void;
212
- private getMesh;
213
- private getGeometry;
214
- private autoSetWasm;
215
- }
216
- import * as WEBIFC from "web-ifc";
217
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
218
- import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
219
- export declare class IfcPropertiesTiler extends Component implements Disposable {
220
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
221
- onPropertiesStreamed: AsyncEvent<{
222
- type: number;
223
- data: {
224
- [id: number]: any;
225
- };
226
- }>;
227
- onProgress: AsyncEvent<number>;
228
- onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
229
- /** {@link Disposable.onDisposed} */
230
- readonly onDisposed: Event<string>;
231
- enabled: boolean;
232
- settings: PropertiesStreamingSettings;
233
- webIfc: WEBIFC.IfcAPI;
234
- dispose(): Promise<void>;
235
- streamFromBuffer(data: Uint8Array): Promise<void>;
236
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
237
- private readIfcFile;
238
- private streamIfcFile;
239
- private streamAllProperties;
240
- private cleanUp;
241
- }
242
- import * as WEBIFC from "web-ifc";
243
- import * as FRAG from "@thatopen/fragments";
244
- import { Component, Components } from "../../core";
245
- /**
246
- * Object to export all the properties from an IFC to a JS object.
247
- */
248
- export declare class IfcJsonExporter extends Component {
249
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
250
- /** {@link Component.enabled} */
251
- enabled: boolean;
252
- constructor(components: Components);
253
- /**
254
- * Exports all the properties of an IFC into an array of JS objects.
255
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
256
- * @param modelID ID of the IFC model whose properties to extract.
257
- * @param indirect whether to get the indirect relationships as well.
258
- * @param recursiveSpatial whether to get the properties of spatial items recursively
259
- * to make the location data available (e.g. absolute position of building).
260
- */
261
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
262
- }
263
- import * as WEBIFC from "web-ifc";
264
- import { FragmentsGroup } from "@thatopen/fragments";
265
- import { Component, Disposable, Event, Components } from "../../core";
266
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
267
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
268
- type NumericPropTypes = "IfcInteger" | "IfcReal";
269
- interface ChangeMap {
270
- [modelID: string]: Set<number>;
271
- }
272
- interface AttributeListener {
273
- [modelID: string]: {
274
- [expressID: number]: {
275
- [attributeName: string]: Event<String | Boolean | Number>;
276
- };
277
- };
278
- }
279
- export declare class IfcPropertiesManager extends Component implements Disposable {
280
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
281
- /** {@link Disposable.onDisposed} */
282
- readonly onDisposed: Event<string>;
283
- readonly onRequestFile: Event<unknown>;
284
- ifcToExport: ArrayBuffer | null;
285
- readonly onElementToPset: Event<{
286
- model: FragmentsGroup;
287
- psetID: number;
288
- elementID: number;
289
- }>;
290
- readonly onPropToPset: Event<{
291
- model: FragmentsGroup;
292
- psetID: number;
293
- propID: number;
294
- }>;
295
- readonly onPsetRemoved: Event<{
296
- model: FragmentsGroup;
297
- psetID: number;
298
- }>;
299
- readonly onDataChanged: Event<{
300
- model: FragmentsGroup;
301
- expressID: number;
302
- }>;
303
- wasm: {
304
- path: string;
305
- absolute: boolean;
306
- };
307
- enabled: boolean;
308
- attributeListeners: AttributeListener;
309
- selectedModel?: FragmentsGroup;
310
- changeMap: ChangeMap;
311
- constructor(components: Components);
312
- dispose(): void;
313
- private increaseMaxID;
314
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
315
- private newGUID;
316
- private getOwnerHistory;
317
- private registerChange;
318
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
319
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
320
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
321
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
322
- }>;
323
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
324
- private newSingleProperty;
325
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
326
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
327
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
328
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
329
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
330
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
331
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
332
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
333
- }
334
- export {};
335
2
  import * as WEBIFC from "web-ifc";
336
3
  import { FragmentsGroup } from "@thatopen/fragments";
337
4
  import { Disposable, Event, Component, Components } from "../../core";
@@ -464,6 +131,112 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
464
131
  dispose(): void;
465
132
  }
466
133
  export type { InverseAttribute, RelationsMap } from "./src/types";
134
+ import * as WEBIFC from "web-ifc";
135
+ import * as FRAG from "@thatopen/fragments";
136
+ import { Component, Components } from "../../core";
137
+ /**
138
+ * Object to export all the properties from an IFC to a JS object.
139
+ */
140
+ export declare class IfcJsonExporter extends Component {
141
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
142
+ /** {@link Component.enabled} */
143
+ enabled: boolean;
144
+ constructor(components: Components);
145
+ /**
146
+ * Exports all the properties of an IFC into an array of JS objects.
147
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
148
+ * @param modelID ID of the IFC model whose properties to extract.
149
+ * @param indirect whether to get the indirect relationships as well.
150
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
151
+ * to make the location data available (e.g. absolute position of building).
152
+ */
153
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
154
+ }
155
+ import { Component, Disposable, World, Event } from "../Types";
156
+ import { SimpleRaycaster } from "./src";
157
+ import { Components } from "../Components";
158
+ export declare class Raycasters extends Component implements Disposable {
159
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
160
+ enabled: boolean;
161
+ list: Map<string, SimpleRaycaster>;
162
+ onDisposed: Event<unknown>;
163
+ constructor(components: Components);
164
+ get(world: World): SimpleRaycaster;
165
+ delete(world: World): void;
166
+ dispose(): void;
167
+ }
168
+ import * as WEBIFC from "web-ifc";
169
+ import { FragmentsGroup } from "@thatopen/fragments";
170
+ import { Component, Disposable, Event, Components } from "../../core";
171
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
172
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
173
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
174
+ interface ChangeMap {
175
+ [modelID: string]: Set<number>;
176
+ }
177
+ interface AttributeListener {
178
+ [modelID: string]: {
179
+ [expressID: number]: {
180
+ [attributeName: string]: Event<String | Boolean | Number>;
181
+ };
182
+ };
183
+ }
184
+ export declare class IfcPropertiesManager extends Component implements Disposable {
185
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
186
+ /** {@link Disposable.onDisposed} */
187
+ readonly onDisposed: Event<string>;
188
+ readonly onRequestFile: Event<unknown>;
189
+ ifcToExport: ArrayBuffer | null;
190
+ readonly onElementToPset: Event<{
191
+ model: FragmentsGroup;
192
+ psetID: number;
193
+ elementID: number;
194
+ }>;
195
+ readonly onPropToPset: Event<{
196
+ model: FragmentsGroup;
197
+ psetID: number;
198
+ propID: number;
199
+ }>;
200
+ readonly onPsetRemoved: Event<{
201
+ model: FragmentsGroup;
202
+ psetID: number;
203
+ }>;
204
+ readonly onDataChanged: Event<{
205
+ model: FragmentsGroup;
206
+ expressID: number;
207
+ }>;
208
+ wasm: {
209
+ path: string;
210
+ absolute: boolean;
211
+ };
212
+ enabled: boolean;
213
+ attributeListeners: AttributeListener;
214
+ selectedModel?: FragmentsGroup;
215
+ changeMap: ChangeMap;
216
+ constructor(components: Components);
217
+ dispose(): void;
218
+ private increaseMaxID;
219
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
220
+ private newGUID;
221
+ private getOwnerHistory;
222
+ private registerChange;
223
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
224
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
225
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
226
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
227
+ }>;
228
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
229
+ private newSingleProperty;
230
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
231
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
232
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
233
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
234
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
235
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
236
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
237
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
238
+ }
239
+ export {};
467
240
  import { Component, Disposable, Event } from "../Types";
468
241
  /**
469
242
  * The entry point of the Components library.
@@ -508,37 +281,13 @@ export declare class Components implements Disposable {
508
281
  * - Any of the objects of this instance (meshes, geometries, etc) is
509
282
  * referenced by a reference type (object or array).
510
283
  *
511
- * You can learn more about how Three.js handles memory leaks
512
- * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
513
- *
514
- */
515
- dispose(): void;
516
- private update;
517
- private static setupBVH;
518
- }
519
- import * as THREE from "three";
520
- import { Component, Components } from "../../core";
521
- export interface MeasureEdge {
522
- distance: number;
523
- points: THREE.Vector3[];
524
- }
525
- export declare class MeasurementUtils extends Component {
526
- enabled: boolean;
527
- static uuid: string;
528
- constructor(components: Components);
529
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
530
- edges: MeasureEdge[];
531
- indices: Set<number>;
532
- } | null;
533
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
534
- private getFaceData;
535
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
536
- p1: THREE.Vector3;
537
- p2: THREE.Vector3;
538
- p3: THREE.Vector3;
539
- faceNormal: THREE.Vector3;
540
- };
541
- private round;
284
+ * You can learn more about how Three.js handles memory leaks
285
+ * [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
286
+ *
287
+ */
288
+ dispose(): void;
289
+ private update;
290
+ private static setupBVH;
542
291
  }
543
292
  import * as THREE from "three";
544
293
  import { Components } from "../Components";
@@ -583,18 +332,29 @@ export declare class Disposer extends Component {
583
332
  private disposeChildren;
584
333
  private static disposeMaterial;
585
334
  }
586
- import { Component, Disposable, World, Event } from "../Types";
587
- import { SimpleRaycaster } from "./src";
588
- import { Components } from "../Components";
589
- export declare class Raycasters extends Component implements Disposable {
590
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
335
+ import * as THREE from "three";
336
+ import { Component, Components } from "../../core";
337
+ export interface MeasureEdge {
338
+ distance: number;
339
+ points: THREE.Vector3[];
340
+ }
341
+ export declare class MeasurementUtils extends Component {
591
342
  enabled: boolean;
592
- list: Map<string, SimpleRaycaster>;
593
- onDisposed: Event<unknown>;
343
+ static uuid: string;
594
344
  constructor(components: Components);
595
- get(world: World): SimpleRaycaster;
596
- delete(world: World): void;
597
- dispose(): void;
345
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
346
+ edges: MeasureEdge[];
347
+ indices: Set<number>;
348
+ } | null;
349
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
350
+ private getFaceData;
351
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
352
+ p1: THREE.Vector3;
353
+ p2: THREE.Vector3;
354
+ p3: THREE.Vector3;
355
+ faceNormal: THREE.Vector3;
356
+ };
357
+ private round;
598
358
  }
599
359
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
600
360
  import { Components } from "../Components";
@@ -665,28 +425,6 @@ export declare class UUID {
665
425
  static create(): string;
666
426
  static validate(uuid: string): void;
667
427
  }
668
- import { Component, Disposable, World, Event } from "../Types";
669
- import { GridConfig, SimpleGrid } from "./src";
670
- import { Components } from "../Components";
671
- export declare class Grids extends Component implements Disposable {
672
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
673
- list: Map<string, SimpleGrid>;
674
- readonly onDisposed: Event<unknown>;
675
- config: Required<GridConfig>;
676
- /** {@link Component.enabled} */
677
- enabled: boolean;
678
- constructor(components: Components);
679
- create(world: World): SimpleGrid;
680
- delete(world: World): void;
681
- dispose(): void;
682
- }
683
- import * as WEBIFC from "web-ifc";
684
- export interface IfcItemsCategories {
685
- [itemID: number]: number;
686
- }
687
- export declare class IfcCategories {
688
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
689
- }
690
428
  import * as THREE from "three";
691
429
  import { Component, Components, Event, World } from "../core";
692
430
  export interface VertexPickerConfig {
@@ -715,9 +453,6 @@ export declare class VertexPicker extends Component {
715
453
  private getVertices;
716
454
  private getVertex;
717
455
  }
718
- export declare const IfcElements: {
719
- [key: number]: string;
720
- };
721
456
  import * as THREE from "three";
722
457
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
723
458
  import { SimplePlane } from "./src";
@@ -817,6 +552,21 @@ export declare class Clipper extends Component implements Createable, Disposable
817
552
  private _onStartDragging;
818
553
  private _onEndDragging;
819
554
  }
555
+ import { Component, Disposable, World, Event } from "../Types";
556
+ import { GridConfig, SimpleGrid } from "./src";
557
+ import { Components } from "../Components";
558
+ export declare class Grids extends Component implements Disposable {
559
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
560
+ list: Map<string, SimpleGrid>;
561
+ readonly onDisposed: Event<unknown>;
562
+ config: Required<GridConfig>;
563
+ /** {@link Component.enabled} */
564
+ enabled: boolean;
565
+ constructor(components: Components);
566
+ create(world: World): SimpleGrid;
567
+ delete(world: World): void;
568
+ dispose(): void;
569
+ }
820
570
  import { Components } from "../Components";
821
571
  import { MeshCullerRenderer, CullerRendererSettings } from "./src";
822
572
  import { Component, Event, Disposable, World } from "../Types";
@@ -855,86 +605,270 @@ export declare class Cullers extends Component implements Disposable {
855
605
  */
856
606
  set enabled(value: boolean);
857
607
  constructor(components: Components);
858
- /**
859
- * Creates a new MeshCullerRenderer for the given world.
860
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
861
- *
862
- * @param world - The world for which to create the MeshCullerRenderer.
863
- * @param config - Optional configuration settings for the MeshCullerRenderer.
864
- *
865
- * @returns The newly created or existing MeshCullerRenderer for the given world.
866
- */
867
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
868
- delete(world: World): void;
869
- /** {@link Disposable.dispose} */
608
+ /**
609
+ * Creates a new MeshCullerRenderer for the given world.
610
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
611
+ *
612
+ * @param world - The world for which to create the MeshCullerRenderer.
613
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
614
+ *
615
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
616
+ */
617
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
618
+ delete(world: World): void;
619
+ /** {@link Disposable.dispose} */
620
+ dispose(): void;
621
+ }
622
+ import { MiniMap } from "./src";
623
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
624
+ import { Components } from "../Components";
625
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
626
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
627
+ readonly onAfterUpdate: Event<unknown>;
628
+ readonly onBeforeUpdate: Event<unknown>;
629
+ readonly onDisposed: Event<unknown>;
630
+ enabled: boolean;
631
+ list: Map<string, MiniMap>;
632
+ constructor(components: Components);
633
+ create(world: World): MiniMap;
634
+ delete(id: string): void;
635
+ dispose(): void;
636
+ update(): void;
637
+ }
638
+ import * as THREE from "three";
639
+ import { Components } from "../Components";
640
+ import { SimpleCamera } from "..";
641
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
642
+ /**
643
+ * A flexible camera that uses
644
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
645
+ * easily control the camera in 2D and 3D. It supports multiple navigation
646
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
647
+ */
648
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
649
+ /**
650
+ * The current {@link NavigationMode}.
651
+ */
652
+ _mode: NavigationMode | null;
653
+ readonly projection: ProjectionManager;
654
+ readonly threeOrtho: THREE.OrthographicCamera;
655
+ readonly threePersp: THREE.PerspectiveCamera;
656
+ protected readonly _userInputButtons: any;
657
+ protected readonly _frustumSize = 50;
658
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
659
+ private previousSize;
660
+ get mode(): NavigationMode;
661
+ constructor(components: Components);
662
+ /** {@link Disposable.dispose} */
663
+ dispose(): void;
664
+ /**
665
+ * Sets a new {@link NavigationMode} and disables the previous one.
666
+ *
667
+ * @param mode - The {@link NavigationMode} to set.
668
+ */
669
+ set(mode: NavModeID): void;
670
+ /**
671
+ * Make the camera view fit all the specified meshes.
672
+ *
673
+ * @param meshes the meshes to fit. If it is not defined, it will
674
+ * evaluate {@link Components.meshes}.
675
+ * @param offset the distance to the fit object
676
+ */
677
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
678
+ /**
679
+ * Allows or prevents all user input.
680
+ *
681
+ * @param active - whether to enable or disable user inputs.
682
+ */
683
+ setUserInput(active: boolean): void;
684
+ private disableUserInput;
685
+ private enableUserInput;
686
+ private newOrthoCamera;
687
+ private setOrthoPerspCameraAspect;
688
+ }
689
+ import * as THREE from "three";
690
+ import * as FRAGS from "@thatopen/fragments";
691
+ import { FragmentsGroup } from "@thatopen/fragments";
692
+ import { Component, Components, Disposable, Event } from "../../core";
693
+ /**
694
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
695
+ * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
696
+ */
697
+ export declare class BoundingBoxer extends Component implements Disposable {
698
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
699
+ /** {@link Component.enabled} */
700
+ enabled: boolean;
701
+ /** {@link Disposable.onDisposed} */
702
+ readonly onDisposed: Event<unknown>;
703
+ private _absoluteMin;
704
+ private _absoluteMax;
705
+ private _meshes;
706
+ constructor(components: Components);
707
+ static getDimensions(bbox: THREE.Box3): {
708
+ width: number;
709
+ height: number;
710
+ depth: number;
711
+ center: THREE.Vector3;
712
+ };
713
+ static newBound(positive: boolean): THREE.Vector3;
714
+ static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
715
+ /** {@link Disposable.dispose} */
716
+ dispose(): void;
717
+ get(): THREE.Box3;
718
+ getSphere(): THREE.Sphere;
719
+ getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
720
+ reset(): void;
721
+ add(group: FragmentsGroup): void;
722
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
723
+ private static getFragmentBounds;
724
+ }
725
+ import * as THREE from "three";
726
+ import * as FRAGS from "@thatopen/fragments";
727
+ import { Disposable, Component, Event, Components } from "../../core";
728
+ export interface Classification {
729
+ [system: string]: {
730
+ [className: string]: FRAGS.FragmentIdMap;
731
+ };
732
+ }
733
+ export declare class Classifier extends Component implements Disposable {
734
+ static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
735
+ /** {@link Component.enabled} */
736
+ enabled: boolean;
737
+ list: Classification;
738
+ /** {@link Disposable.onDisposed} */
739
+ readonly onDisposed: Event<unknown>;
740
+ constructor(components: Components);
741
+ private onFragmentsDisposed;
742
+ dispose(): void;
743
+ remove(guid: string): void;
744
+ find(filter?: {
745
+ [name: string]: string[];
746
+ }): FRAGS.FragmentIdMap;
747
+ byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
748
+ byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
749
+ byEntity(group: FRAGS.FragmentsGroup): void;
750
+ byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
751
+ bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
752
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
753
+ resetColor(items: FRAGS.FragmentIdMap): void;
754
+ protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
755
+ }
756
+ import { Component, Disposable, Event, Components } from "../../core";
757
+ export declare class Exploder extends Component implements Disposable {
758
+ static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
759
+ enabled: boolean;
760
+ height: number;
761
+ groupName: string;
762
+ /** {@link Disposable.onDisposed} */
763
+ readonly onDisposed: Event<unknown>;
764
+ list: Set<string>;
765
+ constructor(components: Components);
766
+ dispose(): void;
767
+ set(active: boolean): void;
768
+ }
769
+ import * as WEBIFC from "web-ifc";
770
+ import * as FRAGS from "@thatopen/fragments";
771
+ import { IfcFragmentSettings } from "./src";
772
+ import { Component, Components, Event, Disposable } from "../../core";
773
+ export declare class IfcLoader extends Component implements Disposable {
774
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
775
+ readonly onIfcStartedLoading: Event<void>;
776
+ readonly onSetup: Event<void>;
777
+ /** {@link Disposable.onDisposed} */
778
+ readonly onDisposed: Event<string>;
779
+ settings: IfcFragmentSettings;
780
+ enabled: boolean;
781
+ webIfc: WEBIFC.IfcAPI;
782
+ private _material;
783
+ private _spatialTree;
784
+ private _metaData;
785
+ private _fragmentInstances;
786
+ private _civil;
787
+ private _visitedFragments;
788
+ private _materialT;
789
+ constructor(components: Components);
870
790
  dispose(): void;
791
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
792
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
793
+ readIfcFile(data: Uint8Array): Promise<number>;
794
+ private getAllGeometries;
795
+ cleanUp(): void;
796
+ private getMesh;
797
+ private getGeometry;
798
+ private autoSetWasm;
871
799
  }
872
- import { MiniMap } from "./src";
873
- import { Component, Updateable, World, Event, Disposable } from "../Types";
874
- import { Components } from "../Components";
875
- export declare class MiniMaps extends Component implements Updateable, Disposable {
876
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
877
- readonly onAfterUpdate: Event<unknown>;
878
- readonly onBeforeUpdate: Event<unknown>;
879
- readonly onDisposed: Event<unknown>;
800
+ import * as FRAGS from "@thatopen/fragments";
801
+ import { Components, Component } from "../../core";
802
+ export declare class Hider extends Component {
803
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
880
804
  enabled: boolean;
881
- list: Map<string, MiniMap>;
882
805
  constructor(components: Components);
883
- create(world: World): MiniMap;
884
- delete(id: string): void;
885
- dispose(): void;
886
- update(): void;
806
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
807
+ isolate(items: FRAGS.FragmentIdMap): void;
808
+ private updateCulledVisibility;
887
809
  }
810
+ import { Fragment, FragmentsGroup } from "@thatopen/fragments";
888
811
  import * as THREE from "three";
889
- import { Components } from "../Components";
890
- import { SimpleCamera } from "..";
891
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
812
+ import * as FRAGS from "@thatopen/fragments";
813
+ import { Component, Components, Event, Disposable } from "../../core";
814
+ import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
892
815
  /**
893
- * A flexible camera that uses
894
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
895
- * easily control the camera in 2D and 3D. It supports multiple navigation
896
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
816
+ * Object that can efficiently load binary files that contain
817
+ * [fragment geometry](https://github.com/ThatOpen/engine_fragment).
897
818
  */
898
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
899
- /**
900
- * The current {@link NavigationMode}.
901
- */
902
- _mode: NavigationMode | null;
903
- readonly projection: ProjectionManager;
904
- readonly threeOrtho: THREE.OrthographicCamera;
905
- readonly threePersp: THREE.PerspectiveCamera;
906
- protected readonly _userInputButtons: any;
907
- protected readonly _frustumSize = 50;
908
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
909
- private previousSize;
910
- get mode(): NavigationMode;
819
+ export declare class FragmentsManager extends Component implements Disposable {
820
+ static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
821
+ /** {@link Disposable.onDisposed} */
822
+ readonly onDisposed: Event<unknown>;
823
+ readonly onFragmentsLoaded: Event<FragmentsGroup>;
824
+ readonly onFragmentsDisposed: Event<{
825
+ groupID: string;
826
+ fragmentIDs: string[];
827
+ }>;
828
+ /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
829
+ readonly list: Map<string, Fragment>;
830
+ readonly groups: Map<string, FragmentsGroup>;
831
+ /** {@link Component.enabled} */
832
+ enabled: boolean;
833
+ baseCoordinationModel: string;
834
+ private _loader;
835
+ /** The list of meshes of the created fragments. */
836
+ get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
911
837
  constructor(components: Components);
912
838
  /** {@link Disposable.dispose} */
913
839
  dispose(): void;
840
+ disposeGroup(group: FragmentsGroup): void;
914
841
  /**
915
- * Sets a new {@link NavigationMode} and disables the previous one.
916
- *
917
- * @param mode - The {@link NavigationMode} to set.
918
- */
919
- set(mode: NavModeID): void;
920
- /**
921
- * Make the camera view fit all the specified meshes.
922
- *
923
- * @param meshes the meshes to fit. If it is not defined, it will
924
- * evaluate {@link Components.meshes}.
925
- * @param offset the distance to the fit object
842
+ * Loads a binar file that contain fragment geometry.
843
+ * @param data - The binary data to load.
844
+ * @param config - Optional configuration for loading.
845
+ * @param config.coordinate - Whether to apply coordinate transformation. Default is true.
846
+ * @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
847
+ * @returns The loaded FragmentsGroup.
926
848
  */
927
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
849
+ load(data: Uint8Array, config?: Partial<{
850
+ coordinate: boolean;
851
+ name: string;
852
+ properties: FRAGS.IfcProperties;
853
+ relationsMap: RelationsMap;
854
+ }>): FragmentsGroup;
928
855
  /**
929
- * Allows or prevents all user input.
930
- *
931
- * @param active - whether to enable or disable user inputs.
856
+ * Export the specified fragments.
857
+ * @param group - the fragments group to be exported.
858
+ * @returns the exported data as binary buffer.
932
859
  */
933
- setUserInput(active: boolean): void;
934
- private disableUserInput;
935
- private enableUserInput;
936
- private newOrthoCamera;
937
- private setOrthoPerspCameraAspect;
860
+ export(group: FragmentsGroup): Uint8Array;
861
+ coordinate(models?: FragmentsGroup[]): void;
862
+ }
863
+ export declare const IfcElements: {
864
+ [key: number]: string;
865
+ };
866
+ import * as WEBIFC from "web-ifc";
867
+ export interface IfcItemsCategories {
868
+ [itemID: number]: number;
869
+ }
870
+ export declare class IfcCategories {
871
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
938
872
  }
939
873
  import * as FRAGS from "@thatopen/fragments";
940
874
  export declare class IfcPropertiesUtils {
@@ -965,19 +899,77 @@ export declare const IfcCategoryMap: {
965
899
  [key: number]: string;
966
900
  };
967
901
  export declare const GeometryTypes: Set<number>;
902
+ import * as WEBIFC from "web-ifc";
903
+ import { Components, Disposable, Event, Component } from "../../core";
904
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
905
+ export declare class IfcGeometryTiler extends Component implements Disposable {
906
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
907
+ onGeometryStreamed: Event<{
908
+ buffer: Uint8Array;
909
+ data: StreamedGeometries;
910
+ }>;
911
+ onAssetStreamed: Event<StreamedAsset[]>;
912
+ onProgress: Event<number>;
913
+ onIfcLoaded: Event<Uint8Array>;
914
+ /** {@link Disposable.onDisposed} */
915
+ readonly onDisposed: Event<unknown>;
916
+ settings: IfcStreamingSettings;
917
+ enabled: boolean;
918
+ webIfc: WEBIFC.IfcAPI;
919
+ private _spatialTree;
920
+ private _metaData;
921
+ private _visitedGeometries;
922
+ private _streamSerializer;
923
+ private _geometries;
924
+ private _geometryCount;
925
+ private _civil;
926
+ private _groupSerializer;
927
+ private _assets;
928
+ private _meshesWithHoles;
929
+ constructor(components: Components);
930
+ dispose(): void;
931
+ streamFromBuffer(data: Uint8Array): Promise<void>;
932
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
933
+ private readIfcFile;
934
+ private streamIfcFile;
935
+ private streamAllGeometries;
936
+ private cleanUp;
937
+ private getMesh;
938
+ private getGeometry;
939
+ private streamAssets;
940
+ private streamGeometries;
941
+ }
942
+ import * as WEBIFC from "web-ifc";
943
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
944
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
945
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
946
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
947
+ onPropertiesStreamed: AsyncEvent<{
948
+ type: number;
949
+ data: {
950
+ [id: number]: any;
951
+ };
952
+ }>;
953
+ onProgress: AsyncEvent<number>;
954
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
955
+ /** {@link Disposable.onDisposed} */
956
+ readonly onDisposed: Event<string>;
957
+ enabled: boolean;
958
+ settings: PropertiesStreamingSettings;
959
+ webIfc: WEBIFC.IfcAPI;
960
+ dispose(): Promise<void>;
961
+ streamFromBuffer(data: Uint8Array): Promise<void>;
962
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
963
+ private readIfcFile;
964
+ private streamIfcFile;
965
+ private streamAllProperties;
966
+ private cleanUp;
967
+ }
968
968
  import { InverseAttribute } from "./types";
969
969
  export declare const relToAttributesMap: Map<number, {
970
970
  forRelating: InverseAttribute;
971
971
  forRelated: InverseAttribute;
972
972
  }>;
973
- import * as WEBIFC from "web-ifc";
974
- import { IfcItemsCategories } from "../../../ifc";
975
- export declare class SpatialStructure {
976
- itemsByFloor: IfcItemsCategories;
977
- private _units;
978
- setUp(webIfc: WEBIFC.IfcAPI): void;
979
- cleanUp(): void;
980
- }
981
973
  import * as THREE from "three";
982
974
  import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
983
975
  export declare class MiniMap implements Resizeable, Updateable, Disposable {
@@ -999,52 +991,26 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
999
991
  private _tempVector1;
1000
992
  private _tempVector2;
1001
993
  private _tempTarget;
1002
- private readonly down;
1003
- get lockRotation(): boolean;
1004
- set lockRotation(active: boolean);
1005
- get zoom(): number;
1006
- set zoom(value: number);
1007
- constructor(world: World);
1008
- dispose(): void;
1009
- get(): THREE.OrthographicCamera;
1010
- update(): void;
1011
- getSize(): THREE.Vector2;
1012
- resize(size?: THREE.Vector2): void;
1013
- private updatePlanes;
1014
- }
1015
- /**
1016
- * Simple event handler by
1017
- * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1018
- * Keep in mind that:
1019
- * - If you want to remove it later, you might want to declare the callback as
1020
- * an object.
1021
- * - If you want to maintain the reference to 'this', you will need to declare
1022
- * the callback as an arrow function.
1023
- */
1024
- export declare class Event<T> {
1025
- /**
1026
- * Add a callback to this event instance.
1027
- * @param handler - the callback to be added to this event.
1028
- */
1029
- add(handler: T extends void ? {
1030
- (): void;
1031
- } : {
1032
- (data: T): void;
1033
- }): void;
1034
- /**
1035
- * Removes a callback from this event instance.
1036
- * @param handler - the callback to be removed from this event.
1037
- */
1038
- remove(handler: T extends void ? {
1039
- (): void;
1040
- } : {
1041
- (data: T): void;
1042
- }): void;
1043
- /** Triggers all the callbacks assigned to this event. */
1044
- trigger: (data?: T) => void;
1045
- /** Gets rid of all the suscribed events. */
1046
- reset(): void;
1047
- private handlers;
994
+ private readonly down;
995
+ get lockRotation(): boolean;
996
+ set lockRotation(active: boolean);
997
+ get zoom(): number;
998
+ set zoom(value: number);
999
+ constructor(world: World);
1000
+ dispose(): void;
1001
+ get(): THREE.OrthographicCamera;
1002
+ update(): void;
1003
+ getSize(): THREE.Vector2;
1004
+ resize(size?: THREE.Vector2): void;
1005
+ private updatePlanes;
1006
+ }
1007
+ import * as WEBIFC from "web-ifc";
1008
+ import { IfcItemsCategories } from "../../../ifc";
1009
+ export declare class SpatialStructure {
1010
+ itemsByFloor: IfcItemsCategories;
1011
+ private _units;
1012
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1013
+ cleanUp(): void;
1048
1014
  }
1049
1015
  /**
1050
1016
  * Simple event handler by
@@ -1204,23 +1170,6 @@ export interface CameraControllable {
1204
1170
  controls: CameraControls;
1205
1171
  }
1206
1172
  import { Base } from "./base";
1207
- import { World } from "./world";
1208
- import { Event } from "./event";
1209
- import { Components } from "../../Components";
1210
- /**
1211
- * One of the elements that make a world. It can be either a scene, a camera
1212
- * or a renderer.
1213
- */
1214
- export declare abstract class BaseWorldItem extends Base {
1215
- readonly worlds: Map<string, World>;
1216
- readonly onWorldChanged: Event<{
1217
- world: World;
1218
- action: "added" | "removed";
1219
- }>;
1220
- currentWorld: World | null;
1221
- protected constructor(components: Components);
1222
- }
1223
- import { Base } from "./base";
1224
1173
  /**
1225
1174
  * Components are the building blocks of this library. Components are singleton
1226
1175
  * elements that contain specific functionality. For instance, the SimpleClipper
@@ -1238,6 +1187,40 @@ export declare abstract class Component extends Base {
1238
1187
  */
1239
1188
  abstract enabled: boolean;
1240
1189
  }
1190
+ /**
1191
+ * Simple event handler by
1192
+ * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
1193
+ * Keep in mind that:
1194
+ * - If you want to remove it later, you might want to declare the callback as
1195
+ * an object.
1196
+ * - If you want to maintain the reference to 'this', you will need to declare
1197
+ * the callback as an arrow function.
1198
+ */
1199
+ export declare class Event<T> {
1200
+ /**
1201
+ * Add a callback to this event instance.
1202
+ * @param handler - the callback to be added to this event.
1203
+ */
1204
+ add(handler: T extends void ? {
1205
+ (): void;
1206
+ } : {
1207
+ (data: T): void;
1208
+ }): void;
1209
+ /**
1210
+ * Removes a callback from this event instance.
1211
+ * @param handler - the callback to be removed from this event.
1212
+ */
1213
+ remove(handler: T extends void ? {
1214
+ (): void;
1215
+ } : {
1216
+ (data: T): void;
1217
+ }): void;
1218
+ /** Triggers all the callbacks assigned to this event. */
1219
+ trigger: (data?: T) => void;
1220
+ /** Gets rid of all the suscribed events. */
1221
+ reset(): void;
1222
+ private handlers;
1223
+ }
1241
1224
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1242
1225
  import { Components } from "../../Components";
1243
1226
  /**
@@ -1257,6 +1240,34 @@ export declare abstract class Base {
1257
1240
  /** Whether is component is {@link Configurable}. */
1258
1241
  isConfigurable: () => this is Configurable<any>;
1259
1242
  }
1243
+ import { Base } from "./base";
1244
+ import { World } from "./world";
1245
+ import { Event } from "./event";
1246
+ import { Components } from "../../Components";
1247
+ /**
1248
+ * One of the elements that make a world. It can be either a scene, a camera
1249
+ * or a renderer.
1250
+ */
1251
+ export declare abstract class BaseWorldItem extends Base {
1252
+ readonly worlds: Map<string, World>;
1253
+ readonly onWorldChanged: Event<{
1254
+ world: World;
1255
+ action: "added" | "removed";
1256
+ }>;
1257
+ currentWorld: World | null;
1258
+ protected constructor(components: Components);
1259
+ }
1260
+ import * as THREE from "three";
1261
+ import CameraControls from "camera-controls";
1262
+ import { BaseWorldItem } from "./base-world-item";
1263
+ import { CameraControllable } from "./interfaces";
1264
+ export declare abstract class BaseCamera extends BaseWorldItem {
1265
+ abstract enabled: boolean;
1266
+ abstract three: THREE.Camera;
1267
+ abstract controls?: CameraControls;
1268
+ /** Whether is instance is {@link CameraControllable}. */
1269
+ hasCameraControls: () => this is CameraControllable;
1270
+ }
1260
1271
  import * as THREE from "three";
1261
1272
  import { Vector2 } from "three";
1262
1273
  import { Event } from "./event";
@@ -1298,30 +1309,6 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
1298
1309
  setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1299
1310
  }
1300
1311
  import * as THREE from "three";
1301
- import CameraControls from "camera-controls";
1302
- import { BaseWorldItem } from "./base-world-item";
1303
- import { CameraControllable } from "./interfaces";
1304
- export declare abstract class BaseCamera extends BaseWorldItem {
1305
- abstract enabled: boolean;
1306
- abstract three: THREE.Camera;
1307
- abstract controls?: CameraControls;
1308
- /** Whether is instance is {@link CameraControllable}. */
1309
- hasCameraControls: () => this is CameraControllable;
1310
- }
1311
- import * as THREE from "three";
1312
- import { BaseScene } from "./base-scene";
1313
- import { BaseCamera } from "./base-camera";
1314
- import { BaseRenderer } from "./base-renderer";
1315
- import { Updateable, Disposable } from "./interfaces";
1316
- export interface World extends Disposable, Updateable {
1317
- meshes: Set<THREE.Mesh>;
1318
- scene: BaseScene;
1319
- camera: BaseCamera;
1320
- renderer: BaseRenderer | null;
1321
- uuid: string;
1322
- isDisposing: boolean;
1323
- }
1324
- import * as THREE from "three";
1325
1312
  import { Disposable } from "./interfaces";
1326
1313
  import { Event } from "./event";
1327
1314
  import { Components } from "../../Components";
@@ -1335,138 +1322,17 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
1335
1322
  dispose(): void;
1336
1323
  }
1337
1324
  import * as THREE from "three";
1338
- import { Disposable, Event } from "../../Types";
1339
- /**
1340
- * A helper to easily get the real position of the mouse in the Three.js canvas
1341
- * to work with tools like the
1342
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1343
- * been transformed through CSS or doesn't occupy the whole screen.
1344
- */
1345
- export declare class Mouse implements Disposable {
1346
- dom: HTMLCanvasElement;
1347
- private _event?;
1348
- private _position;
1349
- /** {@link Disposable.onDisposed} */
1350
- readonly onDisposed: Event<unknown>;
1351
- constructor(dom: HTMLCanvasElement);
1352
- /**
1353
- * The real position of the mouse of the Three.js canvas.
1354
- */
1355
- get position(): THREE.Vector2;
1356
- /** {@link Disposable.dispose} */
1357
- dispose(): void;
1358
- private getPositionY;
1359
- private getPositionX;
1360
- private updateMouseInfo;
1361
- private setupEvents;
1362
- }
1363
- import * as THREE from "three";
1364
- import { Hideable, Event, World, Disposable } from "../../Types";
1365
- import { Components } from "../../Components";
1366
- export interface GridConfig {
1367
- color: THREE.Color;
1368
- size1: number;
1369
- size2: number;
1370
- distance: number;
1371
- }
1372
- /**
1373
- * An infinite grid. Created by
1374
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1375
- * and translated to typescript by
1376
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1377
- */
1378
- export declare class SimpleGrid implements Hideable, Disposable {
1379
- /** {@link Disposable.onDisposed} */
1380
- readonly onDisposed: Event<unknown>;
1381
- world: World;
1382
- components: Components;
1383
- /** {@link Hideable.visible} */
1384
- get visible(): boolean;
1385
- /** {@link Hideable.visible} */
1386
- set visible(visible: boolean);
1387
- /** The material of the grid. */
1388
- get material(): THREE.ShaderMaterial;
1389
- /**
1390
- * Whether the grid should fade away with distance. Recommended to be true for
1391
- * perspective cameras and false for orthographic cameras.
1392
- */
1393
- get fade(): boolean;
1394
- /**
1395
- * Whether the grid should fade away with distance. Recommended to be true for
1396
- * perspective cameras and false for orthographic cameras.
1397
- */
1398
- set fade(active: boolean);
1399
- readonly three: THREE.Mesh;
1400
- private _fade;
1401
- constructor(components: Components, world: World, config: GridConfig);
1402
- /** {@link Disposable.dispose} */
1403
- dispose(): void;
1404
- private setupEvents;
1405
- private updateZoom;
1406
- }
1407
- import * as THREE from "three";
1408
- import { Components } from "../../Components";
1409
- import { Event, World, Disposable } from "../../Types";
1410
- import { Mouse } from "./mouse";
1411
- /**
1412
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1413
- * that allows to easily get items from the scene using the mouse and touch
1414
- * events.
1415
- */
1416
- export declare class SimpleRaycaster implements Disposable {
1417
- /** {@link Component.enabled} */
1418
- enabled: boolean;
1419
- components: Components;
1420
- /** {@link Disposable.onDisposed} */
1421
- readonly onDisposed: Event<unknown>;
1422
- /** The position of the mouse in the screen. */
1423
- readonly mouse: Mouse;
1424
- readonly three: THREE.Raycaster;
1425
- world: World;
1426
- constructor(components: Components, world: World);
1427
- /** {@link Disposable.dispose} */
1428
- dispose(): void;
1429
- /**
1430
- * Throws a ray from the camera to the mouse or touch event point and returns
1431
- * the first item found. This also takes into account the clipping planes
1432
- * used by the renderer.
1433
- *
1434
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1435
- * to query. If not provided, it will query all the meshes stored in
1436
- * {@link Components.meshes}.
1437
- */
1438
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1439
- 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;
1440
- private intersect;
1441
- private filterClippingPlanes;
1442
- }
1443
- import * as THREE from "three";
1444
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1445
- import { Components } from "../../Components";
1446
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1447
- /**
1448
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1449
- */
1450
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1451
- readonly onAfterUpdate: Event<unknown>;
1452
- readonly onBeforeUpdate: Event<unknown>;
1453
- isDisposing: boolean;
1454
- enabled: boolean;
1455
- uuid: string;
1456
- name?: string;
1457
- readonly onDisposed: Event<unknown>;
1458
- private _scene?;
1459
- private _camera?;
1460
- private _renderer;
1461
- get scene(): T;
1462
- set scene(scene: T);
1463
- get camera(): U;
1464
- set camera(camera: U);
1465
- get renderer(): S | null;
1466
- set renderer(renderer: S | null);
1467
- constructor(components: Components);
1468
- update(delta?: number): void;
1469
- dispose(disposeResources?: boolean): void;
1325
+ import { BaseScene } from "./base-scene";
1326
+ import { BaseCamera } from "./base-camera";
1327
+ import { BaseRenderer } from "./base-renderer";
1328
+ import { Updateable, Disposable } from "./interfaces";
1329
+ export interface World extends Disposable, Updateable {
1330
+ meshes: Set<THREE.Mesh>;
1331
+ scene: BaseScene;
1332
+ camera: BaseCamera;
1333
+ renderer: BaseRenderer | null;
1334
+ uuid: string;
1335
+ isDisposing: boolean;
1470
1336
  }
1471
1337
  import * as THREE from "three";
1472
1338
  import { BaseScene, Configurable, Event } from "../../Types";
@@ -1499,6 +1365,34 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1499
1365
  setup(config?: Partial<SimpleSceneConfig>): void;
1500
1366
  }
1501
1367
  import * as THREE from "three";
1368
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1369
+ import { Components } from "../../Components";
1370
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1371
+ /**
1372
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1373
+ */
1374
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1375
+ readonly onAfterUpdate: Event<unknown>;
1376
+ readonly onBeforeUpdate: Event<unknown>;
1377
+ isDisposing: boolean;
1378
+ enabled: boolean;
1379
+ uuid: string;
1380
+ name?: string;
1381
+ readonly onDisposed: Event<unknown>;
1382
+ private _scene?;
1383
+ private _camera?;
1384
+ private _renderer;
1385
+ get scene(): T;
1386
+ set scene(scene: T);
1387
+ get camera(): U;
1388
+ set camera(camera: U);
1389
+ get renderer(): S | null;
1390
+ set renderer(renderer: S | null);
1391
+ constructor(components: Components);
1392
+ update(delta?: number): void;
1393
+ dispose(disposeResources?: boolean): void;
1394
+ }
1395
+ import * as THREE from "three";
1502
1396
  import { BaseRenderer, Event } from "../../Types";
1503
1397
  import { Components } from "../../Components";
1504
1398
  /**
@@ -1531,6 +1425,50 @@ export declare class SimpleRenderer extends BaseRenderer {
1531
1425
  private onContextBack;
1532
1426
  }
1533
1427
  import * as THREE from "three";
1428
+ import { Hideable, Event, World, Disposable } from "../../Types";
1429
+ import { Components } from "../../Components";
1430
+ export interface GridConfig {
1431
+ color: THREE.Color;
1432
+ size1: number;
1433
+ size2: number;
1434
+ distance: number;
1435
+ }
1436
+ /**
1437
+ * An infinite grid. Created by
1438
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1439
+ * and translated to typescript by
1440
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1441
+ */
1442
+ export declare class SimpleGrid implements Hideable, Disposable {
1443
+ /** {@link Disposable.onDisposed} */
1444
+ readonly onDisposed: Event<unknown>;
1445
+ world: World;
1446
+ components: Components;
1447
+ /** {@link Hideable.visible} */
1448
+ get visible(): boolean;
1449
+ /** {@link Hideable.visible} */
1450
+ set visible(visible: boolean);
1451
+ /** The material of the grid. */
1452
+ get material(): THREE.ShaderMaterial;
1453
+ /**
1454
+ * Whether the grid should fade away with distance. Recommended to be true for
1455
+ * perspective cameras and false for orthographic cameras.
1456
+ */
1457
+ get fade(): boolean;
1458
+ /**
1459
+ * Whether the grid should fade away with distance. Recommended to be true for
1460
+ * perspective cameras and false for orthographic cameras.
1461
+ */
1462
+ set fade(active: boolean);
1463
+ readonly three: THREE.Mesh;
1464
+ private _fade;
1465
+ constructor(components: Components, world: World, config: GridConfig);
1466
+ /** {@link Disposable.dispose} */
1467
+ dispose(): void;
1468
+ private setupEvents;
1469
+ private updateZoom;
1470
+ }
1471
+ import * as THREE from "three";
1534
1472
  import CameraControls from "camera-controls";
1535
1473
  import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1536
1474
  import { Components } from "../../Components";
@@ -1576,192 +1514,26 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
1576
1514
  private setupEvents;
1577
1515
  private static getSubsetOfThree;
1578
1516
  }
1579
- import * as THREE from "three";
1580
- import * as WEBIFC from "web-ifc";
1581
- import * as FRAGS from "@thatopen/fragments";
1582
- export declare class CivilReader {
1583
- defLineMat: THREE.LineBasicMaterial;
1584
- read(webIfc: WEBIFC.IfcAPI): {
1585
- alignments: Map<number, FRAGS.Alignment>;
1586
- coordinationMatrix: THREE.Matrix4;
1587
- } | undefined;
1588
- get(civilItems: any): {
1589
- alignments: Map<number, FRAGS.Alignment>;
1590
- coordinationMatrix: THREE.Matrix4;
1591
- } | undefined;
1592
- private getCurves;
1593
- }
1594
- import * as WEBIFC from "web-ifc";
1595
- /** Configuration of the IFC-fragment conversion. */
1596
- export declare class IfcFragmentSettings {
1597
- /** Whether to extract the IFC properties into a JSON. */
1598
- includeProperties: boolean;
1599
- /**
1600
- * Generate the geometry for categories that are not included by default,
1601
- * like IFCSPACE.
1602
- */
1603
- optionalCategories: number[];
1604
- /** Whether to use the coordination data coming from the IFC files. */
1605
- coordinate: boolean;
1606
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1607
- wasm: {
1608
- path: string;
1609
- absolute: boolean;
1610
- logLevel?: WEBIFC.LogLevel;
1611
- };
1612
- /** List of categories that won't be converted to fragments. */
1613
- excludedCategories: Set<number>;
1614
- /** Whether to save the absolute location of all IFC items. */
1615
- saveLocations: boolean;
1616
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1617
- webIfc: WEBIFC.LoaderSettings;
1618
- autoSetWasm: boolean;
1619
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1620
- }
1621
- import * as WEBIFC from "web-ifc";
1622
- export declare class IfcMetadataReader {
1623
- getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1624
- getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1625
- }
1626
- import { IfcFragmentSettings } from "../../IfcLoader/src";
1627
- /** Configuration of the IFC-fragment streaming. */
1628
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1629
- minGeometrySize: number;
1630
- minAssetsSize: number;
1631
- }
1632
- /** Configuration of the IFC-fragment streaming. */
1633
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1634
- propertiesSize: number;
1635
- }
1636
- import * as WEBIFC from "web-ifc";
1637
- import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1638
- import { PropertiesStreamingSettings } from "./streaming-settings";
1639
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1640
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1641
- onPropertiesStreamed: AsyncEvent<{
1642
- type: number;
1643
- data: {
1644
- [id: number]: any;
1645
- };
1646
- }>;
1647
- onProgress: AsyncEvent<number>;
1648
- onIndicesStreamed: AsyncEvent<number[][]>;
1649
- /** {@link Disposable.onDisposed} */
1650
- readonly onDisposed: Event<string>;
1651
- enabled: boolean;
1652
- settings: PropertiesStreamingSettings;
1653
- webIfc: WEBIFC.IfcAPI;
1654
- dispose(): Promise<void>;
1655
- streamFromBuffer(data: Uint8Array): Promise<void>;
1656
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1657
- private readIfcFile;
1658
- private streamIfcFile;
1659
- private streamAllProperties;
1660
- private getIndices;
1661
- private cleanUp;
1662
- }
1663
- export interface StreamedGeometries {
1664
- [id: number]: {
1665
- boundingBox: Float32Array;
1666
- hasHoles: boolean;
1667
- geometryFile?: string;
1668
- };
1669
- }
1670
- export interface StreamedAsset {
1671
- id: number;
1672
- geometries: {
1673
- geometryID: number;
1674
- transformation: number[];
1675
- color: number[];
1676
- }[];
1677
- }
1678
- import * as WEBIFC from "web-ifc";
1679
- import * as THREE from "three";
1680
- export declare class Units {
1681
- factor: number;
1682
- complement: number;
1683
- apply(matrix: THREE.Matrix4): void;
1684
- setUp(webIfc: WEBIFC.IfcAPI): void;
1685
- private getLengthUnits;
1686
- private getScaleMatrix;
1687
- }
1688
- import * as THREE from "three";
1689
- import { Hideable, Disposable, Event, World } from "../../Types";
1690
- import { Components } from "../../Components";
1691
- /**
1692
- * Each of the planes created by {@link SimpleClipper}.
1693
- */
1694
- export declare class SimplePlane implements Disposable, Hideable {
1695
- /** Event that fires when the user starts dragging a clipping plane. */
1696
- readonly onDraggingStarted: Event<unknown>;
1697
- /** Event that fires when the user stops dragging a clipping plane. */
1698
- readonly onDraggingEnded: Event<unknown>;
1699
- /** {@link Disposable.onDisposed} */
1700
- readonly onDisposed: Event<unknown>;
1701
- readonly normal: THREE.Vector3;
1702
- readonly origin: THREE.Vector3;
1703
- readonly three: THREE.Plane;
1704
- protected readonly _helper: THREE.Object3D;
1705
- protected _visible: boolean;
1706
- protected _enabled: boolean;
1707
- components: Components;
1708
- world: World;
1709
- private _controlsActive;
1710
- private readonly _arrowBoundBox;
1711
- private readonly _planeMesh;
1712
- private readonly _controls;
1713
- private readonly _hiddenMaterial;
1714
- get enabled(): boolean;
1715
- /** {@link Component.enabled} */
1716
- set enabled(state: boolean);
1717
- /** {@link Hideable.visible } */
1718
- get visible(): boolean;
1719
- /** {@link Hideable.visible } */
1720
- set visible(state: boolean);
1721
- /** The meshes used for raycasting */
1722
- get meshes(): THREE.Mesh[];
1723
- /** The material of the clipping plane representation. */
1724
- get planeMaterial(): THREE.Material | THREE.Material[];
1725
- /** The material of the clipping plane representation. */
1726
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1727
- /** The size of the clipping plane representation. */
1728
- get size(): number;
1729
- /** Sets the size of the clipping plane representation. */
1730
- set size(size: number);
1731
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1732
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1733
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1734
- /** {@link Updateable.update} */
1735
- update: () => void;
1736
- /** {@link Disposable.dispose} */
1737
- dispose(): void;
1738
- private reset;
1739
- protected toggleControls(state: boolean): void;
1740
- private newTransformControls;
1741
- private initializeControls;
1742
- private createArrowBoundingBox;
1743
- private changeDrag;
1744
- private notifyDraggingChanged;
1745
- private preventCameraMovement;
1746
- private newHelper;
1747
- private static newPlaneMesh;
1748
- }
1749
1517
  import { NavigationMode } from "./types";
1750
1518
  import { OrthoPerspectiveCamera } from "../index";
1751
1519
  /**
1752
- * A {@link NavigationMode} that allows first person navigation,
1753
- * simulating FPS video games.
1520
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1521
+ * like many BIM tools.
1754
1522
  */
1755
- export declare class FirstPersonMode implements NavigationMode {
1523
+ export declare class PlanMode implements NavigationMode {
1756
1524
  private camera;
1757
1525
  /** {@link NavigationMode.enabled} */
1758
1526
  enabled: boolean;
1759
1527
  /** {@link NavigationMode.id} */
1760
- readonly id = "FirstPerson";
1528
+ readonly id = "Plan";
1529
+ private mouseAction1?;
1530
+ private mouseAction2?;
1531
+ private mouseInitialized;
1532
+ private readonly defaultAzimuthSpeed;
1533
+ private readonly defaultPolarSpeed;
1761
1534
  constructor(camera: OrthoPerspectiveCamera);
1762
1535
  /** {@link NavigationMode.set} */
1763
1536
  set(active: boolean): void;
1764
- private setupFirstPersonCamera;
1765
1537
  }
1766
1538
  import { NavigationMode } from "./types";
1767
1539
  import { OrthoPerspectiveCamera } from "../index";
@@ -1783,23 +1555,19 @@ export declare class OrbitMode implements NavigationMode {
1783
1555
  import { NavigationMode } from "./types";
1784
1556
  import { OrthoPerspectiveCamera } from "../index";
1785
1557
  /**
1786
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1787
- * like many BIM tools.
1558
+ * A {@link NavigationMode} that allows first person navigation,
1559
+ * simulating FPS video games.
1788
1560
  */
1789
- export declare class PlanMode implements NavigationMode {
1561
+ export declare class FirstPersonMode implements NavigationMode {
1790
1562
  private camera;
1791
1563
  /** {@link NavigationMode.enabled} */
1792
1564
  enabled: boolean;
1793
1565
  /** {@link NavigationMode.id} */
1794
- readonly id = "Plan";
1795
- private mouseAction1?;
1796
- private mouseAction2?;
1797
- private mouseInitialized;
1798
- private readonly defaultAzimuthSpeed;
1799
- private readonly defaultPolarSpeed;
1566
+ readonly id = "FirstPerson";
1800
1567
  constructor(camera: OrthoPerspectiveCamera);
1801
1568
  /** {@link NavigationMode.set} */
1802
1569
  set(active: boolean): void;
1570
+ private setupFirstPersonCamera;
1803
1571
  }
1804
1572
  import * as THREE from "three";
1805
1573
  import { CameraProjection } from "./types";
@@ -1866,6 +1634,68 @@ export interface NavigationMode {
1866
1634
  enabled: boolean;
1867
1635
  }
1868
1636
  import * as THREE from "three";
1637
+ import { Disposable, Event } from "../../Types";
1638
+ /**
1639
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1640
+ * to work with tools like the
1641
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1642
+ * been transformed through CSS or doesn't occupy the whole screen.
1643
+ */
1644
+ export declare class Mouse implements Disposable {
1645
+ dom: HTMLCanvasElement;
1646
+ private _event?;
1647
+ private _position;
1648
+ /** {@link Disposable.onDisposed} */
1649
+ readonly onDisposed: Event<unknown>;
1650
+ constructor(dom: HTMLCanvasElement);
1651
+ /**
1652
+ * The real position of the mouse of the Three.js canvas.
1653
+ */
1654
+ get position(): THREE.Vector2;
1655
+ /** {@link Disposable.dispose} */
1656
+ dispose(): void;
1657
+ private getPositionY;
1658
+ private getPositionX;
1659
+ private updateMouseInfo;
1660
+ private setupEvents;
1661
+ }
1662
+ import * as THREE from "three";
1663
+ import { Components } from "../../Components";
1664
+ import { Event, World, Disposable } from "../../Types";
1665
+ import { Mouse } from "./mouse";
1666
+ /**
1667
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1668
+ * that allows to easily get items from the scene using the mouse and touch
1669
+ * events.
1670
+ */
1671
+ export declare class SimpleRaycaster implements Disposable {
1672
+ /** {@link Component.enabled} */
1673
+ enabled: boolean;
1674
+ components: Components;
1675
+ /** {@link Disposable.onDisposed} */
1676
+ readonly onDisposed: Event<unknown>;
1677
+ /** The position of the mouse in the screen. */
1678
+ readonly mouse: Mouse;
1679
+ readonly three: THREE.Raycaster;
1680
+ world: World;
1681
+ constructor(components: Components, world: World);
1682
+ /** {@link Disposable.dispose} */
1683
+ dispose(): void;
1684
+ /**
1685
+ * Throws a ray from the camera to the mouse or touch event point and returns
1686
+ * the first item found. This also takes into account the clipping planes
1687
+ * used by the renderer.
1688
+ *
1689
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1690
+ * to query. If not provided, it will query all the meshes stored in
1691
+ * {@link Components.meshes}.
1692
+ */
1693
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1694
+ 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;
1695
+ private intersect;
1696
+ private filterClippingPlanes;
1697
+ }
1698
+ import * as THREE from "three";
1869
1699
  import { Components } from "../../Components";
1870
1700
  import { AsyncEvent, Event, World } from "../../Types";
1871
1701
  export interface CullerRendererSettings {
@@ -1961,6 +1791,176 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1961
1791
  private handleWorkerMessage;
1962
1792
  private getAvailableMaterial;
1963
1793
  }
1794
+ import * as THREE from "three";
1795
+ import { Hideable, Disposable, Event, World } from "../../Types";
1796
+ import { Components } from "../../Components";
1797
+ /**
1798
+ * Each of the planes created by {@link SimpleClipper}.
1799
+ */
1800
+ export declare class SimplePlane implements Disposable, Hideable {
1801
+ /** Event that fires when the user starts dragging a clipping plane. */
1802
+ readonly onDraggingStarted: Event<unknown>;
1803
+ /** Event that fires when the user stops dragging a clipping plane. */
1804
+ readonly onDraggingEnded: Event<unknown>;
1805
+ /** {@link Disposable.onDisposed} */
1806
+ readonly onDisposed: Event<unknown>;
1807
+ readonly normal: THREE.Vector3;
1808
+ readonly origin: THREE.Vector3;
1809
+ readonly three: THREE.Plane;
1810
+ protected readonly _helper: THREE.Object3D;
1811
+ protected _visible: boolean;
1812
+ protected _enabled: boolean;
1813
+ components: Components;
1814
+ world: World;
1815
+ private _controlsActive;
1816
+ private readonly _arrowBoundBox;
1817
+ private readonly _planeMesh;
1818
+ private readonly _controls;
1819
+ private readonly _hiddenMaterial;
1820
+ get enabled(): boolean;
1821
+ /** {@link Component.enabled} */
1822
+ set enabled(state: boolean);
1823
+ /** {@link Hideable.visible } */
1824
+ get visible(): boolean;
1825
+ /** {@link Hideable.visible } */
1826
+ set visible(state: boolean);
1827
+ /** The meshes used for raycasting */
1828
+ get meshes(): THREE.Mesh[];
1829
+ /** The material of the clipping plane representation. */
1830
+ get planeMaterial(): THREE.Material | THREE.Material[];
1831
+ /** The material of the clipping plane representation. */
1832
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
1833
+ /** The size of the clipping plane representation. */
1834
+ get size(): number;
1835
+ /** Sets the size of the clipping plane representation. */
1836
+ set size(size: number);
1837
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1838
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1839
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1840
+ /** {@link Updateable.update} */
1841
+ update: () => void;
1842
+ /** {@link Disposable.dispose} */
1843
+ dispose(): void;
1844
+ private reset;
1845
+ protected toggleControls(state: boolean): void;
1846
+ private newTransformControls;
1847
+ private initializeControls;
1848
+ private createArrowBoundingBox;
1849
+ private changeDrag;
1850
+ private notifyDraggingChanged;
1851
+ private preventCameraMovement;
1852
+ private newHelper;
1853
+ private static newPlaneMesh;
1854
+ }
1855
+ import * as WEBIFC from "web-ifc";
1856
+ /** Configuration of the IFC-fragment conversion. */
1857
+ export declare class IfcFragmentSettings {
1858
+ /** Whether to extract the IFC properties into a JSON. */
1859
+ includeProperties: boolean;
1860
+ /**
1861
+ * Generate the geometry for categories that are not included by default,
1862
+ * like IFCSPACE.
1863
+ */
1864
+ optionalCategories: number[];
1865
+ /** Whether to use the coordination data coming from the IFC files. */
1866
+ coordinate: boolean;
1867
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1868
+ wasm: {
1869
+ path: string;
1870
+ absolute: boolean;
1871
+ logLevel?: WEBIFC.LogLevel;
1872
+ };
1873
+ /** List of categories that won't be converted to fragments. */
1874
+ excludedCategories: Set<number>;
1875
+ /** Whether to save the absolute location of all IFC items. */
1876
+ saveLocations: boolean;
1877
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1878
+ webIfc: WEBIFC.LoaderSettings;
1879
+ autoSetWasm: boolean;
1880
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1881
+ }
1882
+ import * as THREE from "three";
1883
+ import * as WEBIFC from "web-ifc";
1884
+ import * as FRAGS from "@thatopen/fragments";
1885
+ export declare class CivilReader {
1886
+ defLineMat: THREE.LineBasicMaterial;
1887
+ read(webIfc: WEBIFC.IfcAPI): {
1888
+ alignments: Map<number, FRAGS.Alignment>;
1889
+ coordinationMatrix: THREE.Matrix4;
1890
+ } | undefined;
1891
+ get(civilItems: any): {
1892
+ alignments: Map<number, FRAGS.Alignment>;
1893
+ coordinationMatrix: THREE.Matrix4;
1894
+ } | undefined;
1895
+ private getCurves;
1896
+ }
1897
+ import * as WEBIFC from "web-ifc";
1898
+ export declare class IfcMetadataReader {
1899
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1900
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1901
+ }
1902
+ import { IfcFragmentSettings } from "../../IfcLoader/src";
1903
+ /** Configuration of the IFC-fragment streaming. */
1904
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1905
+ minGeometrySize: number;
1906
+ minAssetsSize: number;
1907
+ }
1908
+ /** Configuration of the IFC-fragment streaming. */
1909
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1910
+ propertiesSize: number;
1911
+ }
1912
+ export interface StreamedGeometries {
1913
+ [id: number]: {
1914
+ boundingBox: Float32Array;
1915
+ hasHoles: boolean;
1916
+ geometryFile?: string;
1917
+ };
1918
+ }
1919
+ export interface StreamedAsset {
1920
+ id: number;
1921
+ geometries: {
1922
+ geometryID: number;
1923
+ transformation: number[];
1924
+ color: number[];
1925
+ }[];
1926
+ }
1927
+ import * as WEBIFC from "web-ifc";
1928
+ import * as THREE from "three";
1929
+ export declare class Units {
1930
+ factor: number;
1931
+ complement: number;
1932
+ apply(matrix: THREE.Matrix4): void;
1933
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1934
+ private getLengthUnits;
1935
+ private getScaleMatrix;
1936
+ }
1937
+ import * as WEBIFC from "web-ifc";
1938
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1939
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1940
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1941
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1942
+ onPropertiesStreamed: AsyncEvent<{
1943
+ type: number;
1944
+ data: {
1945
+ [id: number]: any;
1946
+ };
1947
+ }>;
1948
+ onProgress: AsyncEvent<number>;
1949
+ onIndicesStreamed: AsyncEvent<number[][]>;
1950
+ /** {@link Disposable.onDisposed} */
1951
+ readonly onDisposed: Event<string>;
1952
+ enabled: boolean;
1953
+ settings: PropertiesStreamingSettings;
1954
+ webIfc: WEBIFC.IfcAPI;
1955
+ dispose(): Promise<void>;
1956
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1957
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1958
+ private readIfcFile;
1959
+ private streamIfcFile;
1960
+ private streamAllProperties;
1961
+ private getIndices;
1962
+ private cleanUp;
1963
+ }
1964
1964
  export type RelationsMap = Map<number, Map<number, number[]>>;
1965
1965
  export interface ModelsRelationMap {
1966
1966
  [modelID: string]: RelationsMap;