@thatopen/components 2.0.0-alpha.7 → 2.0.0-alpha.9

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.
Files changed (34) hide show
  1. package/dist/core/Clipper/index.d.ts +3 -3
  2. package/dist/core/Materials/index.d.ts +3 -15
  3. package/dist/core/Worlds/src/simple-renderer.d.ts +3 -4
  4. package/dist/core/index.d.ts +2 -0
  5. package/dist/fragments/{FragmentBoundingBox → BoundingBoxes}/index.d.ts +2 -2
  6. package/dist/fragments/FragmentClassifier/index.d.ts +4 -3
  7. package/dist/fragments/FragmentIfcLoader/src/index.d.ts +1 -0
  8. package/dist/fragments/{FragmentIfcStreamer/src/fragment-ifc-stream-converter.d.ts → IfcGeometryTiler/index.d.ts} +4 -4
  9. package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/fragment-props-stream-converter.d.ts +4 -4
  10. package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/index.d.ts +0 -1
  11. package/dist/fragments/IfcPropertiesTiler/index.d.ts +26 -0
  12. package/dist/fragments/index.d.ts +3 -2
  13. package/dist/ifc/IfcRelationsIndexer/index.d.ts +43 -14
  14. package/dist/ifc/IfcRelationsIndexer/src/getRelationMap.d.ts +3 -0
  15. package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +4 -0
  16. package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +24 -0
  17. package/dist/index.cjs +5 -5
  18. package/dist/index.d.ts +0 -1
  19. package/dist/index.mjs +2169 -1856
  20. package/dist/namespace.d.ts +1277 -1204
  21. package/package.json +6 -5
  22. package/dist/fragments/FragmentIfcStreamer/index.d.ts +0 -1
  23. package/dist/navigation/index.d.ts +0 -1
  24. /package/dist/{navigation → core}/MiniMap/index.d.ts +0 -0
  25. /package/dist/{navigation → core}/MiniMap/src/index.d.ts +0 -0
  26. /package/dist/{navigation → core}/OrthoPerspectiveCamera/index.d.ts +0 -0
  27. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -0
  28. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/index.d.ts +0 -0
  29. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -0
  30. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -0
  31. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/projections.d.ts +0 -0
  32. /package/dist/{navigation → core}/OrthoPerspectiveCamera/src/types.d.ts +0 -0
  33. /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/base-types.d.ts +0 -0
  34. /package/dist/fragments/{FragmentIfcStreamer → IfcGeometryTiler}/src/streaming-settings.d.ts +0 -0
@@ -1,4 +1,168 @@
1
1
  declare namespace OBC {
2
+ import * as WEBIFC from "web-ifc";
3
+ import { FragmentsGroup } from "@thatopen/fragments";
4
+ import { Disposable, Event, Component, Components } from "../../core";
5
+ import { RelationsMap, ModelsRelationMap, InverseAttributes, InverseAttribute } from "./src/types";
6
+ /**
7
+ * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
8
+ * 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.
9
+ */
10
+ export declare class IfcRelationsIndexer extends Component implements Disposable {
11
+ static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
12
+ /** {@link Disposable.onDisposed} */
13
+ readonly onDisposed: Event<string>;
14
+ enabled: boolean;
15
+ readonly onRelationsIndexed: Event<{
16
+ modelID: string;
17
+ relationsMap: RelationsMap;
18
+ }>;
19
+ private _relToAttributesMap;
20
+ /**
21
+ * Array of inverse attribute names.
22
+ * This array is used to define the inverse attributes that the indexer will process and index.
23
+ */
24
+ readonly inverseAttributes: InverseAttributes;
25
+ /**
26
+ * Holds the relationship mappings for each model processed by the indexer.
27
+ * The structure is a map where each key is a model's UUID, and the value is another map.
28
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
29
+ * representing a specific relation type, and the value is an array of expressIDs of entities
30
+ * that are related through that relation type. This structure allows for efficient querying
31
+ * of entity relationships within a model.
32
+ */
33
+ readonly relationMaps: ModelsRelationMap;
34
+ constructor(components: Components);
35
+ private onFragmentsDisposed;
36
+ private getAttributeRels;
37
+ /**
38
+ * Adds a relation map to the model's relations map.
39
+ *
40
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
41
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
42
+ *
43
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
44
+ */
45
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
46
+ /**
47
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
48
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
49
+ * and maps them in a structured way to facilitate quick access to related entities.
50
+ *
51
+ * The process involves querying the model for each relation type associated with the inverse attributes
52
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
53
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
54
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
55
+ * of entities that are related through that attribute.
56
+ *
57
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
58
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
59
+ * representation of the relations indexed by entity expressIDs and relation types.
60
+ * @throws An error if the model does not have properties loaded.
61
+ */
62
+ process(model: FragmentsGroup): Promise<RelationsMap>;
63
+ /**
64
+ * Processes a given model from a WebIfc API to index its IFC entities relations based on predefined inverse attributes.
65
+ *
66
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
67
+ * @param modelID - The unique identifier of the model within the WebIfc API.
68
+ * @returns A promise that resolves to the relations map for the processed model.
69
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
70
+ */
71
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
72
+ /**
73
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
74
+ * This method searches the indexed relation maps for the specified model and entity,
75
+ * returning the IDs of related entities if a match is found.
76
+ *
77
+ * @param model The 'FragmentsGroup' model containing the entity.
78
+ * @param expressID The unique identifier of the entity within the model.
79
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
80
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
81
+ * or the specified relation name is not indexed.
82
+ */
83
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
84
+ /**
85
+ * Serializes the relations of a given relation map into a JSON string.
86
+ * 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,
87
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
88
+ * The resulting object is then serialized into a JSON string.
89
+ *
90
+ * @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.
91
+ * @returns A JSON string representing the serialized relations of the given relation map.
92
+ */
93
+ serializeRelations(relationMap: RelationsMap): string;
94
+ /**
95
+ * Serializes the relations of a specific model into a JSON string.
96
+ * This method iterates through the relations indexed for the given model,
97
+ * organizing them into a structured object where each key is an expressID of an entity,
98
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
99
+ * The resulting object is then serialized into a JSON string.
100
+ *
101
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
102
+ * @returns A JSON string representing the serialized relations of the specified model.
103
+ * If the model has no indexed relations, 'null' is returned.
104
+ */
105
+ serializeModelRelations(model: FragmentsGroup): string | null;
106
+ /**
107
+ * Serializes all relations of every model processed by the indexer into a JSON string.
108
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
109
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
110
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
111
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
112
+ *
113
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
114
+ * If no relations have been indexed, an empty object is returned as a JSON string.
115
+ */
116
+ serializeAllRelations(): string;
117
+ /**
118
+ * Converts a JSON string representing relations between entities into a structured map.
119
+ * This method parses the JSON string to reconstruct the relations map that indexes
120
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
121
+ * and the values are maps where each key is a relation type ID and its value is an array
122
+ * of express IDs of entities related through that relation type.
123
+ *
124
+ * @param json The JSON string to be parsed into the relations map.
125
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
126
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
127
+ * is an array of express IDs (as numbers) of entities related through that relation type.
128
+ */
129
+ getRelationsMapFromJSON(json: string): RelationsMap;
130
+ /**
131
+ * Disposes the component, cleaning up resources and detaching event listeners.
132
+ * This ensures that the component is properly cleaned up and does not leave behind any
133
+ * references that could prevent garbage collection.
134
+ */
135
+ dispose(): void;
136
+ }
137
+ import * as WEBIFC from "web-ifc";
138
+ import * as FRAG from "@thatopen/fragments";
139
+ /**
140
+ * Object to export all the properties from an IFC to a JS object.
141
+ */
142
+ export declare class IfcJsonExporter {
143
+ /**
144
+ * Exports all the properties of an IFC into an array of JS objects.
145
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
146
+ * @param modelID ID of the IFC model whose properties to extract.
147
+ * @param indirect whether to get the indirect relationships as well.
148
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
149
+ * to make the location data available (e.g. absolute position of building).
150
+ */
151
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
152
+ }
153
+ import { Component, Disposable, World, Event } from "../Types";
154
+ import { SimpleRaycaster } from "./src";
155
+ import { Components } from "../Components";
156
+ export declare class Raycasters extends Component implements Disposable {
157
+ static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
158
+ enabled: boolean;
159
+ list: Map<string, SimpleRaycaster>;
160
+ onDisposed: Event<unknown>;
161
+ constructor(components: Components);
162
+ get(world: World): SimpleRaycaster;
163
+ delete(world: World): void;
164
+ dispose(): void;
165
+ }
2
166
  import * as THREE from "three";
3
167
  import { Components } from "../Components";
4
168
  import { Component } from "../Types";
@@ -94,32 +258,6 @@ export declare class Components implements Disposable {
94
258
  private update;
95
259
  private static setupBVH;
96
260
  }
97
- import { Component, Disposable, World, Event } from "../Types";
98
- import { GridConfig, SimpleGrid } from "./src";
99
- export declare class Grids extends Component implements Disposable {
100
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
101
- list: Map<string, SimpleGrid>;
102
- onDisposed: Event<unknown>;
103
- config: Required<GridConfig>;
104
- /** {@link Component.enabled} */
105
- enabled: boolean;
106
- create(world: World): void;
107
- delete(world: World): void;
108
- dispose(): void;
109
- }
110
- import { Component, Disposable, World, Event } from "../Types";
111
- import { SimpleRaycaster } from "./src";
112
- import { Components } from "../Components";
113
- export declare class Raycasters extends Component implements Disposable {
114
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
115
- enabled: boolean;
116
- list: Map<string, SimpleRaycaster>;
117
- onDisposed: Event<unknown>;
118
- constructor(components: Components);
119
- get(world: World): SimpleRaycaster;
120
- delete(world: World): void;
121
- dispose(): void;
122
- }
123
261
  import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
124
262
  import { Components } from "../Components";
125
263
  import { SimpleWorld } from "./src";
@@ -136,111 +274,217 @@ export declare class Worlds extends Component implements Updateable, Disposable
136
274
  dispose(): void;
137
275
  update(delta?: number): void | Promise<void>;
138
276
  }
139
- import * as THREE from "three";
140
- import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
141
- import { SimplePlane } from "./src";
277
+ import * as FRAGS from "@thatopen/fragments";
278
+ import { FragmentsGroup } from "@thatopen/fragments";
279
+ import { Disposable, Event, Component, Components } from "../../core";
280
+ import { QueryGroup } from "./src/types";
281
+ export interface QueryResult {
282
+ [modelID: string]: {
283
+ modelEntities: Set<number>;
284
+ otherEntities: Set<number>;
285
+ };
286
+ }
287
+ export interface IndexedModels {
288
+ [modelID: string]: {
289
+ [expressID: number]: Set<number>;
290
+ };
291
+ }
292
+ export declare class IfcPropertiesFinder extends Component implements Disposable {
293
+ readonly onFound: Event<FRAGS.FragmentIdMap>;
294
+ /** {@link Disposable.onDisposed} */
295
+ readonly onDisposed: Event<unknown>;
296
+ enabled: boolean;
297
+ indexedModels: IndexedModels;
298
+ private readonly _conditionFunctions;
299
+ private _noHandleAttributes;
300
+ constructor(components: Components);
301
+ private onFragmentsDisposed;
302
+ dispose(): void;
303
+ private indexEntityRelations;
304
+ find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
305
+ private toFragmentMap;
306
+ private simpleQuery;
307
+ private getMatchingEntities;
308
+ private combineArrays;
309
+ private getCommonElements;
310
+ private arrayIntersection;
311
+ private arrayUnion;
312
+ private getConditionFunctions;
313
+ }
142
314
  import { Components } from "../Components";
315
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
316
+ import { Component, Event, Disposable, World } from "../Types";
143
317
  /**
144
- * A lightweight component to easily create and handle
145
- * [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
146
- *
147
- * @param components - the instance of {@link Components} used.
148
- * @param planeType - the type of plane to be used by the clipper.
149
- * E.g. {@link SimplePlane}.
318
+ * A tool to handle big scenes efficiently by automatically hiding the objects
319
+ * that are not visible to the camera.
150
320
  */
151
- export declare class Clipper<T extends SimplePlane> extends Component implements Createable, Disposable, Hideable {
152
- static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
153
- /** {@link Createable.onAfterCreate} */
154
- readonly onAfterCreate: Event<T>;
155
- /** {@link Createable.onAfterDelete} */
156
- readonly onAfterDelete: Event<T>;
157
- /** Event that fires when the user starts dragging a clipping plane. */
158
- readonly onBeforeDrag: Event<void>;
159
- /** Event that fires when the user stops dragging a clipping plane. */
160
- readonly onAfterDrag: Event<void>;
161
- readonly onBeforeCreate: Event<unknown>;
162
- readonly onBeforeCancel: Event<unknown>;
163
- readonly onAfterCancel: Event<unknown>;
164
- readonly onBeforeDelete: Event<unknown>;
165
- /** {@link Disposable.onDisposed} */
166
- readonly onDisposed: Event<string>;
167
- /**
168
- * Whether to force the clipping plane to be orthogonal in the Y direction
169
- * (up). This is desirable when clipping a building horizontally and a
170
- * clipping plane is created in its roof, which might have a slight
171
- * slope for draining purposes.
172
- */
173
- orthogonalY: boolean;
174
- /**
175
- * The tolerance that determines whether an almost-horizontal clipping plane
176
- * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
177
- * has to be 'true' for this to apply.
178
- */
179
- toleranceOrthogonalY: number;
180
- list: T[];
181
- protected PlaneType: new (...args: any) => SimplePlane | T;
182
- /** The material used in all the clipping planes. */
183
- protected _material: THREE.Material;
184
- private _size;
321
+ export declare class Cullers extends Component implements Disposable {
322
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
185
323
  private _enabled;
186
- private _visible;
324
+ list: Map<string, MeshCullerRenderer>;
325
+ /** {@link Disposable.onDisposed} */
326
+ readonly onDisposed: Event<unknown>;
187
327
  /** {@link Component.enabled} */
188
328
  get enabled(): boolean;
189
- /** {@link Component.enabled} */
190
- set enabled(state: boolean);
191
- /** {@link Hideable.visible } */
192
- get visible(): boolean;
193
- /** {@link Hideable.visible } */
194
- set visible(state: boolean);
195
- /** The material of the clipping plane representation. */
196
- get material(): THREE.Material;
197
- /** The material of the clipping plane representation. */
198
- set material(material: THREE.Material);
199
- /** The size of the geometric representation of the clippings planes. */
200
- get size(): number;
201
- /** The size of the geometric representation of the clippings planes. */
202
- set size(size: number);
329
+ set enabled(value: boolean);
203
330
  constructor(components: Components);
204
- endCreation(): void;
205
- cancelCreation(): void;
331
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
332
+ delete(world: World): void;
206
333
  /** {@link Disposable.dispose} */
207
334
  dispose(): void;
208
- /** {@link Createable.create} */
335
+ }
336
+ import * as WEBIFC from "web-ifc";
337
+ import { FragmentsGroup } from "@thatopen/fragments";
338
+ import { Component, Disposable, Event, Components } from "../../core";
339
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
340
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
341
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
342
+ interface ChangeMap {
343
+ [modelID: string]: Set<number>;
344
+ }
345
+ interface AttributeListener {
346
+ [modelID: string]: {
347
+ [expressID: number]: {
348
+ [attributeName: string]: Event<String | Boolean | Number>;
349
+ };
350
+ };
351
+ }
352
+ export declare class IfcPropertiesManager extends Component implements Disposable {
353
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
354
+ /** {@link Disposable.onDisposed} */
355
+ readonly onDisposed: Event<string>;
356
+ readonly onRequestFile: Event<unknown>;
357
+ ifcToExport: ArrayBuffer | null;
358
+ readonly onElementToPset: Event<{
359
+ model: FragmentsGroup;
360
+ psetID: number;
361
+ elementID: number;
362
+ }>;
363
+ readonly onPropToPset: Event<{
364
+ model: FragmentsGroup;
365
+ psetID: number;
366
+ propID: number;
367
+ }>;
368
+ readonly onPsetRemoved: Event<{
369
+ model: FragmentsGroup;
370
+ psetID: number;
371
+ }>;
372
+ readonly onDataChanged: Event<{
373
+ model: FragmentsGroup;
374
+ expressID: number;
375
+ }>;
376
+ wasm: {
377
+ path: string;
378
+ absolute: boolean;
379
+ };
380
+ enabled: boolean;
381
+ attributeListeners: AttributeListener;
382
+ selectedModel?: FragmentsGroup;
383
+ private _changeMap;
384
+ constructor(components: Components);
385
+ get(): ChangeMap;
386
+ dispose(): void;
387
+ private increaseMaxID;
388
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
389
+ private newGUID;
390
+ private getOwnerHistory;
391
+ private registerChange;
392
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
393
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
394
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
395
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
396
+ }>;
397
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
398
+ private newSingleProperty;
399
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
400
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
401
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
402
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
403
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
404
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
405
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
406
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
407
+ }
408
+ export {};
409
+ import { Component, Disposable, World, Event } from "../Types";
410
+ import { GridConfig, SimpleGrid } from "./src";
411
+ export declare class Grids extends Component implements Disposable {
412
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
413
+ list: Map<string, SimpleGrid>;
414
+ onDisposed: Event<unknown>;
415
+ config: Required<GridConfig>;
416
+ /** {@link Component.enabled} */
417
+ enabled: boolean;
209
418
  create(world: World): void;
210
- /**
211
- * Creates a plane in a certain place and with a certain orientation,
212
- * without the need of the mouse.
213
- *
214
- * @param world - the world where this plane should be created.
215
- * @param normal - the orientation of the clipping plane.
216
- * @param point - the position of the clipping plane.
217
- * navigation.
218
- */
219
- createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): T;
220
- /**
221
- * {@link Createable.delete}
222
- *
223
- * @param world - the world where the plane to delete is.
224
- * @param plane - the plane to delete. If undefined, the first plane
225
- * found under the cursor will be deleted.
226
- */
227
- delete(world: World, plane?: T): void;
228
- /** Deletes all the existing clipping planes. */
229
- deleteAll(): void;
230
- private deletePlane;
231
- private pickPlane;
232
- private getAllPlaneMeshes;
233
- private createPlaneFromIntersection;
234
- private getWorldNormal;
235
- private normalizePlaneDirectionY;
236
- private newPlane;
237
- protected newPlaneInstance(world: World, point: THREE.Vector3, normal: THREE.Vector3): T;
238
- private updateMaterialsAndPlanes;
239
- private _onStartDragging;
240
- private _onEndDragging;
419
+ delete(world: World): void;
420
+ dispose(): void;
421
+ }
422
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
423
+ import * as THREE from "three";
424
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
425
+ center: THREE.Vector3;
426
+ halfSizes: THREE.Vector3;
427
+ rotation: THREE.Matrix3;
428
+ transformation: THREE.Matrix4;
429
+ };
430
+ export declare class UUID {
431
+ private static _pattern;
432
+ private static _lut;
433
+ static create(): string;
434
+ static validate(uuid: string): void;
435
+ }
436
+ import * as THREE from "three";
437
+ export declare class MaterialsUtils {
438
+ static isTransparent(material: THREE.Material): boolean;
439
+ }
440
+ import * as THREE from "three";
441
+ import { Component, Components, Event, World, Disposable } from "../core";
442
+ export interface VertexPickerConfig {
443
+ showOnlyVertex: boolean;
444
+ snapDistance: number;
445
+ previewElement: HTMLElement;
446
+ }
447
+ export declare class VertexPicker extends Component implements Disposable {
448
+ onVertexFound: Event<THREE.Vector3>;
449
+ onVertexLost: Event<THREE.Vector3>;
450
+ components: Components;
451
+ private _pickedPoint;
452
+ private _config;
453
+ private _enabled;
454
+ private _workingPlane;
455
+ /** {@link Disposable.onDisposed} */
456
+ readonly onDisposed: Event<unknown>;
457
+ set enabled(value: boolean);
458
+ get enabled(): boolean;
459
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
460
+ [Symbol.dispose](): void;
461
+ set workingPlane(plane: THREE.Plane | null);
462
+ get workingPlane(): THREE.Plane | null;
463
+ set config(value: Partial<VertexPickerConfig>);
464
+ get config(): Partial<VertexPickerConfig>;
465
+ dispose(): void;
466
+ get(world: World): THREE.Vector3 | null;
467
+ private getClosestVertex;
468
+ private getVertices;
469
+ private getVertex;
470
+ }
471
+ import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
472
+ import { MiniMap } from "./src";
473
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
474
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
475
+ readonly onAfterUpdate: Event<unknown>;
476
+ readonly onBeforeUpdate: Event<unknown>;
477
+ readonly onDisposed: Event<unknown>;
478
+ enabled: boolean;
479
+ list: Map<string, MiniMap>;
480
+ constructor(components: Components);
481
+ create(world: World): MiniMap;
482
+ delete(id: string): void;
483
+ dispose(): void | Promise<void>;
484
+ update(): void;
241
485
  }
242
486
  import * as THREE from "three";
243
- import { Component, Disposable, Event, World } from "../Types";
487
+ import { Component, Disposable, Event } from "../Types";
244
488
  import { Components } from "../Components";
245
489
  /**
246
490
  * A tool to easily handle the materials of massive amounts of
@@ -250,7 +494,6 @@ export declare class Materials extends Component implements Disposable {
250
494
  static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
251
495
  /** {@link Component.enabled} */
252
496
  enabled: boolean;
253
- private _originalBackground;
254
497
  /** {@link Disposable.onDisposed} */
255
498
  readonly onDisposed: Event<string>;
256
499
  list: {
@@ -261,6 +504,8 @@ export declare class Materials extends Component implements Disposable {
261
504
  };
262
505
  private _originals;
263
506
  constructor(components: Components);
507
+ /** {@link Disposable.dispose} */
508
+ dispose(): void;
264
509
  /**
265
510
  * Turns the specified material styles on or off.
266
511
  *
@@ -268,19 +513,6 @@ export declare class Materials extends Component implements Disposable {
268
513
  * @param ids the ids of the style to turn on or off.
269
514
  */
270
515
  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
516
  /**
285
517
  * Creates a new material style.
286
518
  * @param id the identifier of the style to create.
@@ -300,46 +532,176 @@ export declare class Materials extends Component implements Disposable {
300
532
  */
301
533
  removeMeshes(id: string, meshes: THREE.Mesh[]): void;
302
534
  }
303
- import { Components } from "../Components";
304
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
305
- import { Component, Event, Disposable, World } from "../Types";
535
+ import * as THREE from "three";
536
+ import { Components } from "../../core/Components";
537
+ import { SimpleCamera } from "../../core";
538
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
306
539
  /**
307
- * A tool to handle big scenes efficiently by automatically hiding the objects
308
- * that are not visible to the camera.
540
+ * A flexible camera that uses
541
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
542
+ * easily control the camera in 2D and 3D. It supports multiple navigation
543
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
309
544
  */
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);
545
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
546
+ /**
547
+ * The current {@link NavigationMode}.
548
+ */
549
+ mode: NavigationMode;
550
+ readonly projection: ProjectionManager;
551
+ readonly threeOrtho: THREE.OrthographicCamera;
552
+ protected readonly _userInputButtons: any;
553
+ protected readonly _frustumSize = 50;
554
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
555
+ get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
319
556
  constructor(components: Components);
320
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
321
- delete(world: World): void;
322
557
  /** {@link Disposable.dispose} */
323
558
  dispose(): void;
324
- }
325
- import * as THREE from "three";
326
- import * as FRAGS from "@thatopen/fragments";
327
- import { FragmentsGroup } from "@thatopen/fragments";
328
- import { Component, Components, Disposable, Event } from "../../core";
329
- /**
330
- * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
331
- * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
332
- */
333
- export declare class FragmentBoundingBox extends Component implements Disposable {
334
- static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
335
- /** {@link Component.enabled} */
336
- enabled: boolean;
337
- /** {@link Disposable.onDisposed} */
338
- readonly onDisposed: Event<unknown>;
339
- private _absoluteMin;
340
- private _absoluteMax;
341
- private _meshes;
342
- constructor(components: Components);
559
+ /**
560
+ * Sets a new {@link NavigationMode} and disables the previous one.
561
+ *
562
+ * @param mode - The {@link NavigationMode} to set.
563
+ */
564
+ set(mode: NavModeID): void;
565
+ /**
566
+ * Make the camera view fit all the specified meshes.
567
+ *
568
+ * @param meshes the meshes to fit. If it is not defined, it will
569
+ * evaluate {@link Components.meshes}.
570
+ * @param offset the distance to the fit object
571
+ */
572
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
573
+ /**
574
+ * Allows or prevents all user input.
575
+ *
576
+ * @param active - whether to enable or disable user inputs.
577
+ */
578
+ setUserInput(active: boolean): void;
579
+ private disableUserInput;
580
+ private enableUserInput;
581
+ private newOrthoCamera;
582
+ private setOrthoCameraAspect;
583
+ }
584
+ import * as THREE from "three";
585
+ import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
586
+ import { SimplePlane } from "./src";
587
+ import { Components } from "../Components";
588
+ /**
589
+ * A lightweight component to easily create and handle
590
+ * [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
591
+ *
592
+ * @param components - the instance of {@link Components} used.
593
+ * @param planeType - the type of plane to be used by the clipper.
594
+ * E.g. {@link SimplePlane}.
595
+ */
596
+ export declare class Clipper<T extends SimplePlane> extends Component implements Createable, Disposable, Hideable {
597
+ static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
598
+ /** {@link Createable.onAfterCreate} */
599
+ readonly onAfterCreate: Event<T>;
600
+ /** {@link Createable.onAfterDelete} */
601
+ readonly onAfterDelete: Event<T>;
602
+ /** Event that fires when the user starts dragging a clipping plane. */
603
+ readonly onBeforeDrag: Event<void>;
604
+ /** Event that fires when the user stops dragging a clipping plane. */
605
+ readonly onAfterDrag: Event<void>;
606
+ readonly onBeforeCreate: Event<unknown>;
607
+ readonly onBeforeCancel: Event<unknown>;
608
+ readonly onAfterCancel: Event<unknown>;
609
+ readonly onBeforeDelete: Event<unknown>;
610
+ /** {@link Disposable.onDisposed} */
611
+ readonly onDisposed: Event<string>;
612
+ /**
613
+ * Whether to force the clipping plane to be orthogonal in the Y direction
614
+ * (up). This is desirable when clipping a building horizontally and a
615
+ * clipping plane is created in its roof, which might have a slight
616
+ * slope for draining purposes.
617
+ */
618
+ orthogonalY: boolean;
619
+ /**
620
+ * The tolerance that determines whether an almost-horizontal clipping plane
621
+ * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
622
+ * has to be 'true' for this to apply.
623
+ */
624
+ toleranceOrthogonalY: number;
625
+ list: T[];
626
+ protected PlaneType: new (...args: any) => SimplePlane | T;
627
+ /** The material used in all the clipping planes. */
628
+ protected _material: THREE.MeshBasicMaterial;
629
+ private _size;
630
+ private _enabled;
631
+ private _visible;
632
+ /** {@link Component.enabled} */
633
+ get enabled(): boolean;
634
+ /** {@link Component.enabled} */
635
+ set enabled(state: boolean);
636
+ /** {@link Hideable.visible } */
637
+ get visible(): boolean;
638
+ /** {@link Hideable.visible } */
639
+ set visible(state: boolean);
640
+ /** The material of the clipping plane representation. */
641
+ get material(): THREE.MeshBasicMaterial;
642
+ /** The material of the clipping plane representation. */
643
+ set material(material: THREE.MeshBasicMaterial);
644
+ /** The size of the geometric representation of the clippings planes. */
645
+ get size(): number;
646
+ /** The size of the geometric representation of the clippings planes. */
647
+ set size(size: number);
648
+ constructor(components: Components);
649
+ endCreation(): void;
650
+ cancelCreation(): void;
651
+ /** {@link Disposable.dispose} */
652
+ dispose(): void;
653
+ /** {@link Createable.create} */
654
+ create(world: World): void;
655
+ /**
656
+ * Creates a plane in a certain place and with a certain orientation,
657
+ * without the need of the mouse.
658
+ *
659
+ * @param world - the world where this plane should be created.
660
+ * @param normal - the orientation of the clipping plane.
661
+ * @param point - the position of the clipping plane.
662
+ * navigation.
663
+ */
664
+ createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): T;
665
+ /**
666
+ * {@link Createable.delete}
667
+ *
668
+ * @param world - the world where the plane to delete is.
669
+ * @param plane - the plane to delete. If undefined, the first plane
670
+ * found under the cursor will be deleted.
671
+ */
672
+ delete(world: World, plane?: T): void;
673
+ /** Deletes all the existing clipping planes. */
674
+ deleteAll(): void;
675
+ private deletePlane;
676
+ private pickPlane;
677
+ private getAllPlaneMeshes;
678
+ private createPlaneFromIntersection;
679
+ private getWorldNormal;
680
+ private normalizePlaneDirectionY;
681
+ private newPlane;
682
+ protected newPlaneInstance(world: World, point: THREE.Vector3, normal: THREE.Vector3): T;
683
+ private updateMaterialsAndPlanes;
684
+ private _onStartDragging;
685
+ private _onEndDragging;
686
+ }
687
+ import * as THREE from "three";
688
+ import * as FRAGS from "@thatopen/fragments";
689
+ import { FragmentsGroup } from "@thatopen/fragments";
690
+ import { Component, Components, Disposable, Event } from "../../core";
691
+ /**
692
+ * A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
693
+ * it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
694
+ */
695
+ export declare class BoundingBoxes extends Component implements Disposable {
696
+ static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
697
+ /** {@link Component.enabled} */
698
+ enabled: boolean;
699
+ /** {@link Disposable.onDisposed} */
700
+ readonly onDisposed: Event<unknown>;
701
+ private _absoluteMin;
702
+ private _absoluteMax;
703
+ private _meshes;
704
+ constructor(components: Components);
343
705
  static getDimensions(bbox: THREE.Box3): {
344
706
  width: number;
345
707
  height: number;
@@ -355,9 +717,30 @@ export declare class FragmentBoundingBox extends Component implements Disposable
355
717
  getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
356
718
  reset(): void;
357
719
  add(group: FragmentsGroup): void;
358
- addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh): void;
720
+ addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
359
721
  private static getFragmentBounds;
360
722
  }
723
+ import * as THREE from "three";
724
+ export interface MeasureEdge {
725
+ distance: number;
726
+ points: THREE.Vector3[];
727
+ }
728
+ export declare class MeasurementUtils {
729
+ static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
730
+ edges: MeasureEdge[];
731
+ indices: Set<number>;
732
+ } | null;
733
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
734
+ private static getFaceData;
735
+ static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
736
+ p1: THREE.Vector3;
737
+ p2: THREE.Vector3;
738
+ p3: THREE.Vector3;
739
+ faceNormal: THREE.Vector3;
740
+ };
741
+ private static round;
742
+ }
743
+ import * as THREE from "three";
361
744
  import * as FRAGS from "@thatopen/fragments";
362
745
  import { Disposable, Component, Event, Components } from "../../core";
363
746
  export interface Classification {
@@ -369,13 +752,11 @@ export declare class FragmentClassifier extends Component implements Disposable
369
752
  static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
370
753
  /** {@link Component.enabled} */
371
754
  enabled: boolean;
372
- private _groupSystems;
755
+ list: Classification;
373
756
  /** {@link Disposable.onDisposed} */
374
757
  readonly onDisposed: Event<unknown>;
375
758
  constructor(components: Components);
376
759
  private onFragmentsDisposed;
377
- /** {@link Component.get} */
378
- get(): Classification;
379
760
  dispose(): void;
380
761
  remove(guid: string): void;
381
762
  find(filter?: {
@@ -386,6 +767,8 @@ export declare class FragmentClassifier extends Component implements Disposable
386
767
  byEntity(group: FRAGS.FragmentsGroup): void;
387
768
  byStorey(group: FRAGS.FragmentsGroup): void;
388
769
  byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
770
+ setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
771
+ resetColor(items: FRAGS.FragmentIdMap): void;
389
772
  private saveItem;
390
773
  }
391
774
  import { Component, Disposable, Event, Components } from "../../core";
@@ -414,36 +797,11 @@ export declare class FragmentHider extends Component {
414
797
  private updateCulledVisibility;
415
798
  }
416
799
  import * as WEBIFC from "web-ifc";
417
- import * as FRAGS from "@thatopen/fragments";
418
- import { IfcFragmentSettings } from "./src";
419
- import { Component, Components, Event, Disposable } from "../../core";
420
- export declare class FragmentIfcLoader extends Component implements Disposable {
421
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
422
- readonly onIfcStartedLoading: Event<void>;
423
- readonly onSetup: Event<void>;
424
- /** {@link Disposable.onDisposed} */
425
- readonly onDisposed: Event<string>;
426
- settings: IfcFragmentSettings;
427
- enabled: boolean;
428
- webIfc: WEBIFC.IfcAPI;
429
- private _material;
430
- private _spatialTree;
431
- private _metaData;
432
- private _fragmentInstances;
433
- private _civil;
434
- private _propertyExporter;
435
- private _visitedFragments;
436
- private _materialT;
437
- constructor(components: Components);
438
- dispose(): void;
439
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
440
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
441
- readIfcFile(data: Uint8Array): Promise<number>;
442
- private getAllGeometries;
443
- cleanUp(): void;
444
- private getMesh;
445
- private getGeometry;
446
- private autoSetWasm;
800
+ export interface IfcItemsCategories {
801
+ [itemID: number]: number;
802
+ }
803
+ export declare class IfcCategories {
804
+ getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
447
805
  }
448
806
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
449
807
  import * as THREE from "three";
@@ -489,363 +847,259 @@ export declare class FragmentManager extends Component implements Disposable {
489
847
  export(group: FragmentsGroup): Uint8Array;
490
848
  coordinate(models?: FragmentsGroup[]): void;
491
849
  }
492
- import * as THREE from "three";
493
- import { Components } from "../../core/Components";
494
- import { SimpleCamera } from "../../core";
495
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
496
- /**
497
- * A flexible camera that uses
498
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
499
- * easily control the camera in 2D and 3D. It supports multiple navigation
500
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
501
- */
502
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
503
- /**
504
- * The current {@link NavigationMode}.
505
- */
506
- mode: NavigationMode;
507
- readonly projection: ProjectionManager;
508
- readonly threeOrtho: THREE.OrthographicCamera;
509
- protected readonly _userInputButtons: any;
510
- protected readonly _frustumSize = 50;
511
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
512
- get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
513
- constructor(components: Components);
514
- /** {@link Disposable.dispose} */
515
- dispose(): void;
516
- /**
517
- * Sets a new {@link NavigationMode} and disables the previous one.
518
- *
519
- * @param mode - The {@link NavigationMode} to set.
520
- */
521
- set(mode: NavModeID): void;
522
- /**
523
- * Make the camera view fit all the specified meshes.
524
- *
525
- * @param meshes the meshes to fit. If it is not defined, it will
526
- * evaluate {@link Components.meshes}.
527
- * @param offset the distance to the fit object
528
- */
529
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
530
- /**
531
- * Allows or prevents all user input.
532
- *
533
- * @param active - whether to enable or disable user inputs.
534
- */
535
- setUserInput(active: boolean): void;
536
- private disableUserInput;
537
- private enableUserInput;
538
- private newOrthoCamera;
539
- private setOrthoCameraAspect;
540
- }
541
- import * as THREE from "three";
542
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
543
- center: THREE.Vector3;
544
- halfSizes: THREE.Vector3;
545
- rotation: THREE.Matrix3;
546
- transformation: THREE.Matrix4;
547
- };
548
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
549
- export declare class UUID {
550
- private static _pattern;
551
- private static _lut;
552
- static create(): string;
553
- static validate(uuid: string): void;
554
- }
555
- import * as THREE from "three";
556
- export declare class MaterialsUtils {
557
- static isTransparent(material: THREE.Material): boolean;
558
- }
559
- import * as THREE from "three";
560
- import { Component, Components, Event, World, Disposable } from "../core";
561
- export interface VertexPickerConfig {
562
- showOnlyVertex: boolean;
563
- snapDistance: number;
564
- previewElement: HTMLElement;
565
- }
566
- export declare class VertexPicker extends Component implements Disposable {
567
- onVertexFound: Event<THREE.Vector3>;
568
- onVertexLost: Event<THREE.Vector3>;
569
- components: Components;
570
- private _pickedPoint;
571
- private _config;
572
- private _enabled;
573
- private _workingPlane;
574
- /** {@link Disposable.onDisposed} */
575
- readonly onDisposed: Event<unknown>;
576
- set enabled(value: boolean);
577
- get enabled(): boolean;
578
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
579
- [Symbol.dispose](): void;
580
- set workingPlane(plane: THREE.Plane | null);
581
- get workingPlane(): THREE.Plane | null;
582
- set config(value: Partial<VertexPickerConfig>);
583
- get config(): Partial<VertexPickerConfig>;
584
- dispose(): void;
585
- get(world: World): THREE.Vector3 | null;
586
- private getClosestVertex;
587
- private getVertices;
588
- private getVertex;
850
+ import * as FRAGS from "@thatopen/fragments";
851
+ export declare class IfcPropertiesUtils {
852
+ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
853
+ static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
854
+ [attribute: string]: any;
855
+ } | null>;
856
+ static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
857
+ [relatingID: number]: number[];
858
+ }>;
859
+ static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
860
+ static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
861
+ static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
862
+ static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
863
+ static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
864
+ key: string | null;
865
+ name: string | null;
866
+ }>;
867
+ static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
868
+ key: string | null;
869
+ value: number | null;
870
+ }>;
871
+ static isRel(expressID: number): boolean;
872
+ static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
873
+ static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
589
874
  }
590
875
  import * as WEBIFC from "web-ifc";
591
- import * as FRAG from "@thatopen/fragments";
592
- /**
593
- * Object to export all the properties from an IFC to a JS object.
594
- */
595
- export declare class IfcJsonExporter {
596
- /**
597
- * Exports all the properties of an IFC into an array of JS objects.
598
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
599
- * @param modelID ID of the IFC model whose properties to extract.
600
- * @param indirect whether to get the indirect relationships as well.
601
- * @param recursiveSpatial whether to get the properties of spatial items recursively
602
- * to make the location data available (e.g. absolute position of building).
603
- */
604
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
605
- }
606
- import { FragmentsGroup } from "@thatopen/fragments";
607
- import { Disposable, Event, Component, Components } from "../../core";
608
- interface RelationMap {
609
- [modelID: string]: Map<number, Map<number, number[]>>;
610
- }
611
- /**
612
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
613
- * It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
614
- */
615
- export declare class IfcRelationsIndexer extends Component implements Disposable {
616
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
876
+ import * as FRAGS from "@thatopen/fragments";
877
+ import { IfcFragmentSettings } from "./src";
878
+ import { Component, Components, Event, Disposable } from "../../core";
879
+ export declare class FragmentIfcLoader extends Component implements Disposable {
880
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
881
+ readonly onIfcStartedLoading: Event<void>;
882
+ readonly onSetup: Event<void>;
617
883
  /** {@link Disposable.onDisposed} */
618
884
  readonly onDisposed: Event<string>;
885
+ settings: IfcFragmentSettings;
619
886
  enabled: boolean;
620
- /**
621
- * All the inverse attributes this component can processes.
622
- */
623
- readonly inverseAttributes: string[];
624
- inverseAttributesToProcess: string[];
625
- private _relToAttributesMap;
626
- /**
627
- * Holds the relationship mappings for each model processed by the indexer.
628
- * The structure is a map where each key is a model's UUID, and the value is another map.
629
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
630
- * representing a specific relation type, and the value is an array of expressIDs of entities
631
- * that are related through that relation type. This structure allows for efficient querying
632
- * of entity relationships within a model.
633
- */
634
- readonly relationMaps: RelationMap;
887
+ webIfc: WEBIFC.IfcAPI;
888
+ private _material;
889
+ private _spatialTree;
890
+ private _metaData;
891
+ private _fragmentInstances;
892
+ private _civil;
893
+ private _propertyExporter;
894
+ private _visitedFragments;
895
+ private _materialT;
635
896
  constructor(components: Components);
636
- private onFragmentsDisposed;
637
- private getAttributeRels;
638
- private setRelMap;
639
- /**
640
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
641
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
642
- * and maps them in a structured way to facilitate quick access to related entities.
643
- *
644
- * The process involves querying the model for each relation type associated with the inverse attributes
645
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
646
- * and contains a nested map where each key is an entity's expressID and its value is another map.
647
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
648
- * of entities that are related through that attribute.
649
- *
650
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
651
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
652
- * representation of the relations indexed by entity expressIDs and relation types.
653
- * @throws An error if the model does not have properties loaded.
654
- */
655
- process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>;
656
- /**
657
- * Retrieves the relations of a specific entity within a model based on the given relation name.
658
- * This method searches the indexed relation maps for the specified model and entity,
659
- * returning the IDs of related entities if a match is found.
660
- *
661
- * @param model The 'FragmentsGroup' model containing the entity.
662
- * @param expressID The unique identifier of the entity within the model.
663
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
664
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
665
- * or the specified relation name is not indexed.
666
- */
667
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null;
668
- /**
669
- * Serializes the relations of a specific model into a JSON string.
670
- * This method iterates through the relations indexed for the given model,
671
- * organizing them into a structured object where each key is an expressID of an entity,
672
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
673
- * The resulting object is then serialized into a JSON string.
674
- *
675
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
676
- * @returns A JSON string representing the serialized relations of the specified model.
677
- * If the model has no indexed relations, 'null' is returned.
678
- */
679
- serializeModelRelations(model: FragmentsGroup): string | null;
680
- /**
681
- * Serializes all relations of every model processed by the indexer into a JSON string.
682
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
683
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
684
- * and its value is another object mapping entity expressIDs to their related entities, categorized
685
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
686
- *
687
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
688
- * If no relations have been indexed, an empty object is returned as a JSON string.
689
- */
690
- serializeRelations(): string;
691
- /**
692
- * Converts a JSON string representing relations between entities into a structured map.
693
- * This method parses the JSON string to reconstruct the relations map that indexes
694
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
695
- * and the values are maps where each key is a relation type ID and its value is an array
696
- * of express IDs of entities related through that relation type.
697
- *
698
- * @param json The JSON string to be parsed into the relations map.
699
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
700
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
701
- * is an array of express IDs (as numbers) of entities related through that relation type.
702
- */
703
- getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>;
704
- /**
705
- * Disposes the component, cleaning up resources and detaching event listeners.
706
- * This ensures that the component is properly cleaned up and does not leave behind any
707
- * references that could prevent garbage collection.
708
- */
709
897
  dispose(): void;
898
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
899
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
900
+ readIfcFile(data: Uint8Array): Promise<number>;
901
+ private getAllGeometries;
902
+ cleanUp(): void;
903
+ private getMesh;
904
+ private getGeometry;
905
+ private autoSetWasm;
710
906
  }
711
- export {};
712
- import * as FRAGS from "@thatopen/fragments";
713
- import { FragmentsGroup } from "@thatopen/fragments";
714
- import { Disposable, Event, Component, Components } from "../../core";
715
- import { QueryGroup } from "./src/types";
716
- export interface QueryResult {
717
- [modelID: string]: {
718
- modelEntities: Set<number>;
719
- otherEntities: Set<number>;
720
- };
721
- }
722
- export interface IndexedModels {
723
- [modelID: string]: {
724
- [expressID: number]: Set<number>;
725
- };
907
+ export declare const IfcCategoryMap: {
908
+ [key: number]: string;
909
+ };
910
+ export declare const IfcElements: {
911
+ [key: number]: string;
912
+ };
913
+ export declare const GeometryTypes: Set<number>;
914
+ import * as WEBIFC from "web-ifc";
915
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
916
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
917
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
918
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
919
+ onPropertiesStreamed: AsyncEvent<{
920
+ type: number;
921
+ data: {
922
+ [id: number]: any;
923
+ };
924
+ }>;
925
+ onProgress: AsyncEvent<number>;
926
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
927
+ /** {@link Disposable.onDisposed} */
928
+ readonly onDisposed: Event<string>;
929
+ enabled: boolean;
930
+ settings: PropertiesStreamingSettings;
931
+ webIfc: WEBIFC.IfcAPI;
932
+ dispose(): Promise<void>;
933
+ streamFromBuffer(data: Uint8Array): Promise<void>;
934
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
935
+ private readIfcFile;
936
+ private streamIfcFile;
937
+ private streamAllProperties;
938
+ private cleanUp;
726
939
  }
727
- export declare class IfcPropertiesFinder extends Component implements Disposable {
728
- readonly onFound: Event<FRAGS.FragmentIdMap>;
940
+ import * as WEBIFC from "web-ifc";
941
+ import { Components, Disposable, Event, Component } from "../../core";
942
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
943
+ export declare class IfcGeometryTiler extends Component implements Disposable {
944
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
945
+ onGeometryStreamed: Event<{
946
+ buffer: Uint8Array;
947
+ data: StreamedGeometries;
948
+ }>;
949
+ onAssetStreamed: Event<StreamedAsset[]>;
950
+ onProgress: Event<number>;
951
+ onIfcLoaded: Event<Uint8Array>;
729
952
  /** {@link Disposable.onDisposed} */
730
953
  readonly onDisposed: Event<unknown>;
954
+ settings: IfcStreamingSettings;
731
955
  enabled: boolean;
732
- indexedModels: IndexedModels;
733
- private readonly _conditionFunctions;
734
- private _noHandleAttributes;
956
+ webIfc: WEBIFC.IfcAPI;
957
+ private _spatialTree;
958
+ private _metaData;
959
+ private _visitedGeometries;
960
+ private _streamSerializer;
961
+ private _geometries;
962
+ private _geometryCount;
963
+ private _civil;
964
+ private _groupSerializer;
965
+ private _assets;
966
+ private _meshesWithHoles;
735
967
  constructor(components: Components);
736
- private onFragmentsDisposed;
737
968
  dispose(): void;
738
- private indexEntityRelations;
739
- find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
740
- private toFragmentMap;
741
- private simpleQuery;
742
- private getMatchingEntities;
743
- private combineArrays;
744
- private getCommonElements;
745
- private arrayIntersection;
746
- private arrayUnion;
747
- private getConditionFunctions;
748
- }
749
- import * as WEBIFC from "web-ifc";
750
- import { FragmentsGroup } from "@thatopen/fragments";
751
- import { Component, Disposable, Event, Components } from "../../core";
752
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
753
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
754
- type NumericPropTypes = "IfcInteger" | "IfcReal";
755
- interface ChangeMap {
756
- [modelID: string]: Set<number>;
969
+ streamFromBuffer(data: Uint8Array): Promise<void>;
970
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
971
+ private readIfcFile;
972
+ private streamIfcFile;
973
+ private streamAllGeometries;
974
+ private cleanUp;
975
+ private getMesh;
976
+ private getGeometry;
977
+ private streamAssets;
978
+ private streamGeometries;
757
979
  }
758
- interface AttributeListener {
759
- [modelID: string]: {
760
- [expressID: number]: {
761
- [attributeName: string]: Event<String | Boolean | Number>;
762
- };
763
- };
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;
764
1013
  }
765
- export declare class IfcPropertiesManager extends Component implements Disposable {
766
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
767
- /** {@link Disposable.onDisposed} */
768
- readonly onDisposed: Event<string>;
769
- readonly onRequestFile: Event<unknown>;
770
- ifcToExport: ArrayBuffer | null;
771
- readonly onElementToPset: Event<{
772
- model: FragmentsGroup;
773
- psetID: number;
774
- elementID: number;
775
- }>;
776
- readonly onPropToPset: Event<{
777
- model: FragmentsGroup;
778
- psetID: number;
779
- propID: number;
780
- }>;
781
- readonly onPsetRemoved: Event<{
782
- model: FragmentsGroup;
783
- psetID: number;
784
- }>;
785
- readonly onDataChanged: Event<{
786
- model: FragmentsGroup;
787
- expressID: number;
788
- }>;
789
- wasm: {
790
- path: string;
791
- absolute: boolean;
792
- };
1014
+ import * as THREE from "three";
1015
+ import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1016
+ import { Components } from "../../Components";
1017
+ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1018
+ /**
1019
+ * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1020
+ */
1021
+ readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1022
+ readonly onAfterUpdate: Event<unknown>;
1023
+ readonly onBeforeUpdate: Event<unknown>;
793
1024
  enabled: boolean;
794
- attributeListeners: AttributeListener;
795
- selectedModel?: FragmentsGroup;
796
- private _changeMap;
1025
+ uuid: string;
1026
+ readonly onDisposed: Event<unknown>;
1027
+ private _scene?;
1028
+ private _camera?;
1029
+ private _renderer;
1030
+ get scene(): T;
1031
+ set scene(scene: T);
1032
+ get camera(): U;
1033
+ set camera(camera: U);
1034
+ get renderer(): S | null;
1035
+ set renderer(renderer: S | null);
797
1036
  constructor(components: Components);
798
- get(): ChangeMap;
799
- dispose(): void;
800
- private increaseMaxID;
801
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
802
- private newGUID;
803
- private getOwnerHistory;
804
- private registerChange;
805
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
806
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
807
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
808
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
809
- }>;
810
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
811
- private newSingleProperty;
812
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
813
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
814
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
815
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
816
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
817
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
818
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
819
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
1037
+ update(delta?: number): void;
1038
+ dispose(disposeResources?: boolean): void;
820
1039
  }
821
- export {};
822
1040
  import * as THREE from "three";
823
- export interface MeasureEdge {
824
- distance: number;
825
- points: THREE.Vector3[];
1041
+ import { BaseRenderer, Event } from "../../Types";
1042
+ import { Components } from "../../Components";
1043
+ /**
1044
+ * A basic renderer capable of rendering
1045
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1046
+ */
1047
+ export declare class SimpleRenderer extends BaseRenderer {
1048
+ enabled: boolean;
1049
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1050
+ container: HTMLElement;
1051
+ three: THREE.WebGLRenderer;
1052
+ protected _canvas: HTMLCanvasElement;
1053
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1054
+ protected _resizeObserver: ResizeObserver | null;
1055
+ protected onContainerUpdated: Event<HTMLElement>;
1056
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1057
+ /** {@link Updateable.update} */
1058
+ update(): void;
1059
+ /** {@link Disposable.dispose} */
1060
+ dispose(): void;
1061
+ /** {@link Resizeable.getSize}. */
1062
+ getSize(): THREE.Vector2;
1063
+ /** {@link Resizeable.resize} */
1064
+ resize: (size?: THREE.Vector2) => void;
1065
+ setupEvents(active: boolean): void;
1066
+ private resizeEvent;
1067
+ private setupRenderer;
1068
+ private onContextLost;
1069
+ private onContextBack;
826
1070
  }
827
- export declare class MeasurementUtils {
828
- static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
829
- edges: MeasureEdge[];
830
- indices: Set<number>;
831
- } | null;
832
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
833
- private static getFaceData;
834
- static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
835
- p1: THREE.Vector3;
836
- p2: THREE.Vector3;
837
- p3: THREE.Vector3;
838
- faceNormal: THREE.Vector3;
1071
+ export declare const getRelationMap: (properties: Record<string, Record<string, any>>, relationType: number, onElementsFound?: ((relatingID: number, relatedIDs: number[]) => void) | undefined) => {
1072
+ [relatingID: number]: number[];
1073
+ };
1074
+ import * as THREE from "three";
1075
+ import { BaseScene, Configurable, Event } from "../../Types";
1076
+ import { Components } from "../../Components";
1077
+ export interface SimpleSceneConfig {
1078
+ directionalLight: {
1079
+ color: THREE.Color;
1080
+ intensity: number;
1081
+ position: THREE.Vector3;
1082
+ };
1083
+ ambientLight: {
1084
+ color: THREE.Color;
1085
+ intensity: number;
839
1086
  };
840
- private static round;
841
- }
842
- export declare const GeometryTypes: Set<number>;
843
- import * as WEBIFC from "web-ifc";
844
- export interface IfcItemsCategories {
845
- [itemID: number]: number;
846
1087
  }
847
- export declare class IfcCategories {
848
- getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
1088
+ /**
1089
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1090
+ * objects hierarchically, and easily dispose them when you are finished with it.
1091
+ * @noInheritDoc
1092
+ */
1093
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1094
+ /** {@link Configurable.isSetup} */
1095
+ isSetup: boolean;
1096
+ three: THREE.Scene;
1097
+ /** {@link Configurable.onSetup} */
1098
+ readonly onSetup: Event<SimpleScene>;
1099
+ config: Required<SimpleSceneConfig>;
1100
+ constructor(components: Components);
1101
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1102
+ setup(config?: Partial<SimpleSceneConfig>): void;
849
1103
  }
850
1104
  import * as WEBIFC from "web-ifc";
851
1105
  import { IfcItemsCategories } from "../../../ifc";
@@ -855,37 +1109,104 @@ export declare class SpatialStructure {
855
1109
  setUp(webIfc: WEBIFC.IfcAPI): void;
856
1110
  cleanUp(): void;
857
1111
  }
858
- export declare const IfcElements: {
859
- [key: number]: string;
860
- };
861
- export declare const IfcCategoryMap: {
862
- [key: number]: string;
863
- };
864
- import * as FRAGS from "@thatopen/fragments";
865
- export declare class IfcPropertiesUtils {
866
- static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
867
- static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
868
- [attribute: string]: any;
869
- } | null>;
870
- static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
871
- [relatingID: number]: number[];
872
- }>;
873
- static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
874
- static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
875
- static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
876
- static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
877
- static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
878
- key: string | null;
879
- name: string | null;
880
- }>;
881
- static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
882
- key: string | null;
883
- value: number | null;
884
- }>;
885
- static isRel(expressID: number): boolean;
886
- static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
887
- static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
1112
+ import * as THREE from "three";
1113
+ import CameraControls from "camera-controls";
1114
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1115
+ import { Components } from "../../Components";
1116
+ /**
1117
+ * A basic camera that uses
1118
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1119
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1120
+ * what features it offers.
1121
+ */
1122
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1123
+ /** {@link Updateable.onBeforeUpdate} */
1124
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1125
+ /** {@link Updateable.onAfterUpdate} */
1126
+ readonly onAfterUpdate: Event<SimpleCamera>;
1127
+ readonly onAspectUpdated: Event<unknown>;
1128
+ /** {@link Disposable.onDisposed} */
1129
+ readonly onDisposed: Event<string>;
1130
+ readonly three: THREE.PerspectiveCamera;
1131
+ private _allControls;
1132
+ /**
1133
+ * The object that controls the camera. An instance of
1134
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1135
+ * Transforming the camera directly will have no effect: you need to use this
1136
+ * object to move, rotate, look at objects, etc.
1137
+ */
1138
+ get controls(): CameraControls;
1139
+ /** {@link Component.enabled} */
1140
+ get enabled(): boolean;
1141
+ /** {@link Component.enabled} */
1142
+ set enabled(enabled: boolean);
1143
+ constructor(components: Components);
1144
+ /** {@link Disposable.dispose} */
1145
+ dispose(): void;
1146
+ /** {@link Updateable.update} */
1147
+ update(_delta: number): void;
1148
+ /**
1149
+ * Updates the aspect of the camera to match the size of the
1150
+ * {@link Components.renderer}.
1151
+ */
1152
+ updateAspect: () => void;
1153
+ private setupCamera;
1154
+ private newCameraControls;
1155
+ private setupEvents;
1156
+ private static getSubsetOfThree;
1157
+ }
1158
+ /// <reference types="node" />
1159
+ import * as THREE from "three";
1160
+ import { Hideable, Event, World } from "../../Types";
1161
+ import { Components } from "../../Components";
1162
+ export interface GridConfig {
1163
+ color: THREE.Color;
1164
+ size1: number;
1165
+ size2: number;
1166
+ distance: number;
1167
+ }
1168
+ /**
1169
+ * An infinite grid. Created by
1170
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1171
+ * and translated to typescript by
1172
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1173
+ */
1174
+ export declare class SimpleGrid implements Hideable, Disposable {
1175
+ /** {@link Disposable.onDisposed} */
1176
+ readonly onDisposed: Event<unknown>;
1177
+ world: World;
1178
+ components: Components;
1179
+ /** {@link Hideable.visible} */
1180
+ get visible(): boolean;
1181
+ /** {@link Hideable.visible} */
1182
+ set visible(visible: boolean);
1183
+ /** The material of the grid. */
1184
+ get material(): THREE.ShaderMaterial;
1185
+ /**
1186
+ * Whether the grid should fade away with distance. Recommended to be true for
1187
+ * perspective cameras and false for orthographic cameras.
1188
+ */
1189
+ get fade(): boolean;
1190
+ /**
1191
+ * Whether the grid should fade away with distance. Recommended to be true for
1192
+ * perspective cameras and false for orthographic cameras.
1193
+ */
1194
+ set fade(active: boolean);
1195
+ private readonly _grid;
1196
+ private _fade;
1197
+ constructor(components: Components, world: World, config: GridConfig);
1198
+ [Symbol.dispose](): void;
1199
+ /** {@link Component.get} */
1200
+ get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1201
+ /** {@link Disposable.dispose} */
1202
+ dispose(): void;
1203
+ private setupEvents;
1204
+ private updateZoom;
888
1205
  }
1206
+ export declare const relToAttributesMap: Map<number, {
1207
+ forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
1208
+ forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
1209
+ }>;
889
1210
  /**
890
1211
  * Simple event handler by
891
1212
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -920,24 +1241,6 @@ export declare class Event<T> {
920
1241
  reset(): void;
921
1242
  private handlers;
922
1243
  }
923
- import { Base } from "./base";
924
- /**
925
- * Components are the building blocks of this library. Components are singleton
926
- * elements that contain specific functionality. For instance, the SimpleClipper
927
- * Component can create, delete and handle 3D clipping planes. Components must be
928
- * unique (they can't be instanced more than once), and have a static UUID that
929
- * identifies them uniquely. The can be accessed globally using the {@link Components}
930
- * instance.
931
- */
932
- export declare abstract class Component extends Base {
933
- /**
934
- * Whether this component is active or not. The behaviour can vary depending
935
- * on the type of component. E.g. a disabled dimension tool will stop creating
936
- * dimensions, while a disabled camera will stop moving. A disabled component
937
- * will not be updated automatically each frame.
938
- */
939
- abstract enabled: boolean;
940
- }
941
1244
  /**
942
1245
  * Simple event handler by
943
1246
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -972,23 +1275,6 @@ export declare class AsyncEvent<T> {
972
1275
  reset(): void;
973
1276
  private handlers;
974
1277
  }
975
- import { Base } from "./base";
976
- import { World } from "./world";
977
- import { Event } from "./event";
978
- import { Components } from "../../Components";
979
- /**
980
- * One of the elements that make a world. It can be either a scene, a camera
981
- * or a renderer.
982
- */
983
- export declare abstract class BaseWorldItem extends Base {
984
- readonly worlds: Map<string, World>;
985
- readonly onWorldChanged: Event<{
986
- world: World;
987
- action: "added" | "removed";
988
- }>;
989
- currentWorld: World | null;
990
- protected constructor(components: Components);
991
- }
992
1278
  import * as THREE from "three";
993
1279
  import CameraControls from "camera-controls";
994
1280
  import { Event } from "./event";
@@ -1112,6 +1398,41 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1112
1398
  export interface CameraControllable {
1113
1399
  controls: CameraControls;
1114
1400
  }
1401
+ import { Base } from "./base";
1402
+ /**
1403
+ * Components are the building blocks of this library. Components are singleton
1404
+ * elements that contain specific functionality. For instance, the SimpleClipper
1405
+ * Component can create, delete and handle 3D clipping planes. Components must be
1406
+ * unique (they can't be instanced more than once), and have a static UUID that
1407
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
1408
+ * instance.
1409
+ */
1410
+ export declare abstract class Component extends Base {
1411
+ /**
1412
+ * Whether this component is active or not. The behaviour can vary depending
1413
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1414
+ * dimensions, while a disabled camera will stop moving. A disabled component
1415
+ * will not be updated automatically each frame.
1416
+ */
1417
+ abstract enabled: boolean;
1418
+ }
1419
+ import { Base } from "./base";
1420
+ import { World } from "./world";
1421
+ import { Event } from "./event";
1422
+ import { Components } from "../../Components";
1423
+ /**
1424
+ * One of the elements that make a world. It can be either a scene, a camera
1425
+ * or a renderer.
1426
+ */
1427
+ export declare abstract class BaseWorldItem extends Base {
1428
+ readonly worlds: Map<string, World>;
1429
+ readonly onWorldChanged: Event<{
1430
+ world: World;
1431
+ action: "added" | "removed";
1432
+ }>;
1433
+ currentWorld: World | null;
1434
+ protected constructor(components: Components);
1435
+ }
1115
1436
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1116
1437
  import { Components } from "../../Components";
1117
1438
  /**
@@ -1129,237 +1450,71 @@ export declare abstract class Base {
1129
1450
  /** Whether is component is {@link Hideable}. */
1130
1451
  isHideable: () => this is Hideable;
1131
1452
  /** Whether is component is {@link Configurable}. */
1132
- isConfigurable: () => this is Configurable<any>;
1133
- }
1134
- import * as THREE from "three";
1135
- import CameraControls from "camera-controls";
1136
- import { BaseWorldItem } from "./base-world-item";
1137
- import { CameraControllable } from "./interfaces";
1138
- export declare abstract class BaseCamera extends BaseWorldItem {
1139
- abstract enabled: boolean;
1140
- abstract three: THREE.Camera;
1141
- abstract controls?: CameraControls;
1142
- /** Whether is instance is {@link CameraControllable}. */
1143
- hasCameraControls: () => this is CameraControllable;
1144
- }
1145
- import * as THREE from "three";
1146
- import { Vector2 } from "three";
1147
- import { Event } from "./event";
1148
- import { BaseWorldItem } from "./base-world-item";
1149
- import { Disposable, Resizeable, Updateable } from "./interfaces";
1150
- export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
1151
- abstract three: THREE.WebGLRenderer;
1152
- /** {@link Updateable.onBeforeUpdate} */
1153
- onAfterUpdate: Event<unknown>;
1154
- /** {@link Updateable.onAfterUpdate} */
1155
- onBeforeUpdate: Event<unknown>;
1156
- /** {@link Disposable.onDisposed} */
1157
- readonly onDisposed: Event<undefined>;
1158
- readonly onResize: Event<THREE.Vector2>;
1159
- /**
1160
- * Event that fires when there has been a change to the list of clipping
1161
- * planes used by the active renderer.
1162
- */
1163
- readonly onClippingPlanesUpdated: Event<unknown>;
1164
- abstract update(delta?: number): void | Promise<void>;
1165
- abstract dispose(): void;
1166
- abstract getSize(): Vector2;
1167
- abstract resize(size: Vector2 | undefined): void;
1168
- /**
1169
- * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1170
- * instance of the renderer.
1171
- */
1172
- clippingPlanes: THREE.Plane[];
1173
- /**
1174
- * Forces the update of the clipping planes and all components that depend
1175
- * on them that are subscribed to 'onClippingPlanesUpdated'.
1176
- */
1177
- updateClippingPlanes(): void;
1178
- /**
1179
- * Adds or removes a
1180
- * [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
1181
- * to the renderer.
1182
- */
1183
- setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1184
- }
1185
- import * as THREE from "three";
1186
- import { Disposable } from "./interfaces";
1187
- import { Event } from "./event";
1188
- import { Components } from "../../Components";
1189
- import { BaseWorldItem } from "./base-world-item";
1190
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1191
- /** {@link Disposable.onDisposed} */
1192
- readonly onDisposed: Event<unknown>;
1193
- abstract three: THREE.Object3D;
1194
- protected constructor(components: Components);
1195
- /** {@link Disposable.dispose} */
1196
- dispose(): void;
1197
- }
1198
- import * as THREE from "three";
1199
- import { BaseScene } from "./base-scene";
1200
- import { BaseCamera } from "./base-camera";
1201
- import { BaseRenderer } from "./base-renderer";
1202
- import { Updateable, Disposable } from "./interfaces";
1203
- export interface World extends Disposable, Updateable {
1204
- meshes: Set<THREE.Mesh>;
1205
- scene: BaseScene;
1206
- camera: BaseCamera;
1207
- renderer: BaseRenderer | null;
1208
- uuid: string;
1209
- }
1210
- import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1211
- /** Configuration of the IFC-fragment streaming. */
1212
- export declare class IfcStreamingSettings extends IfcFragmentSettings {
1213
- minGeometrySize: number;
1214
- minAssetsSize: number;
1215
- }
1216
- /** Configuration of the IFC-fragment streaming. */
1217
- export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1218
- propertiesSize: number;
1219
- }
1220
- import * as WEBIFC from "web-ifc";
1221
- import { Components, Disposable, Event, Component } from "../../../core";
1222
- import { IfcStreamingSettings } from "./streaming-settings";
1223
- import { StreamedGeometries, StreamedAsset } from "./base-types";
1224
- export declare class FragmentIfcStreamConverter extends Component implements Disposable {
1225
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
1226
- onGeometryStreamed: Event<{
1227
- buffer: Uint8Array;
1228
- data: StreamedGeometries;
1229
- }>;
1230
- onAssetStreamed: Event<StreamedAsset[]>;
1231
- onProgress: Event<number>;
1232
- onIfcLoaded: Event<Uint8Array>;
1233
- /** {@link Disposable.onDisposed} */
1234
- readonly onDisposed: Event<unknown>;
1235
- settings: IfcStreamingSettings;
1236
- enabled: boolean;
1237
- webIfc: WEBIFC.IfcAPI;
1238
- private _spatialTree;
1239
- private _metaData;
1240
- private _visitedGeometries;
1241
- private _streamSerializer;
1242
- private _geometries;
1243
- private _geometryCount;
1244
- private _civil;
1245
- private _groupSerializer;
1246
- private _assets;
1247
- private _meshesWithHoles;
1248
- constructor(components: Components);
1249
- dispose(): void;
1250
- streamFromBuffer(data: Uint8Array): Promise<void>;
1251
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1252
- private readIfcFile;
1253
- private streamIfcFile;
1254
- private streamAllGeometries;
1255
- private cleanUp;
1256
- private getMesh;
1257
- private getGeometry;
1258
- private streamAssets;
1259
- private streamGeometries;
1260
- }
1261
- import * as WEBIFC from "web-ifc";
1262
- import { Component, Disposable, Event } from "../../../core";
1263
- import { PropertiesStreamingSettings } from "./streaming-settings";
1264
- export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1265
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1266
- onPropertiesStreamed: Event<{
1267
- type: number;
1268
- data: {
1269
- [id: number]: any;
1270
- };
1271
- }>;
1272
- onProgress: Event<number>;
1273
- onIndicesStreamed: Event<number[][]>;
1274
- /** {@link Disposable.onDisposed} */
1275
- readonly onDisposed: Event<string>;
1276
- enabled: boolean;
1277
- settings: PropertiesStreamingSettings;
1278
- webIfc: WEBIFC.IfcAPI;
1279
- dispose(): Promise<void>;
1280
- streamFromBuffer(data: Uint8Array): Promise<void>;
1281
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1282
- private readIfcFile;
1283
- private streamIfcFile;
1284
- private streamAllProperties;
1285
- private getIndices;
1286
- private cleanUp;
1287
- }
1288
- export interface StreamedGeometries {
1289
- [id: number]: {
1290
- boundingBox: Float32Array;
1291
- hasHoles: boolean;
1292
- geometryFile?: string;
1293
- };
1453
+ isConfigurable: () => this is Configurable<any>;
1294
1454
  }
1295
- export interface StreamedAsset {
1296
- id: number;
1297
- geometries: {
1298
- geometryID: number;
1299
- transformation: number[];
1300
- color: number[];
1301
- }[];
1455
+ import * as THREE from "three";
1456
+ import CameraControls from "camera-controls";
1457
+ import { BaseWorldItem } from "./base-world-item";
1458
+ import { CameraControllable } from "./interfaces";
1459
+ export declare abstract class BaseCamera extends BaseWorldItem {
1460
+ abstract enabled: boolean;
1461
+ abstract three: THREE.Camera;
1462
+ abstract controls?: CameraControls;
1463
+ /** Whether is instance is {@link CameraControllable}. */
1464
+ hasCameraControls: () => this is CameraControllable;
1302
1465
  }
1303
1466
  import * as THREE from "three";
1304
- import { Hideable, Disposable, Event, World } from "../../Types";
1467
+ import { Vector2 } from "three";
1468
+ import { Event } from "./event";
1469
+ import { BaseWorldItem } from "./base-world-item";
1470
+ import { Disposable, Resizeable, Updateable } from "./interfaces";
1471
+ export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
1472
+ abstract three: THREE.WebGLRenderer;
1473
+ /** {@link Updateable.onBeforeUpdate} */
1474
+ onAfterUpdate: Event<unknown>;
1475
+ /** {@link Updateable.onAfterUpdate} */
1476
+ onBeforeUpdate: Event<unknown>;
1477
+ /** {@link Disposable.onDisposed} */
1478
+ readonly onDisposed: Event<undefined>;
1479
+ readonly onResize: Event<THREE.Vector2>;
1480
+ /**
1481
+ * Event that fires when there has been a change to the list of clipping
1482
+ * planes used by the active renderer.
1483
+ */
1484
+ readonly onClippingPlanesUpdated: Event<unknown>;
1485
+ abstract update(delta?: number): void | Promise<void>;
1486
+ abstract dispose(): void;
1487
+ abstract getSize(): Vector2;
1488
+ abstract resize(size: Vector2 | undefined): void;
1489
+ /**
1490
+ * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1491
+ * instance of the renderer.
1492
+ */
1493
+ clippingPlanes: THREE.Plane[];
1494
+ /**
1495
+ * Forces the update of the clipping planes and all components that depend
1496
+ * on them that are subscribed to 'onClippingPlanesUpdated'.
1497
+ */
1498
+ updateClippingPlanes(): void;
1499
+ /**
1500
+ * Adds or removes a
1501
+ * [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
1502
+ * to the renderer.
1503
+ */
1504
+ setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
1505
+ }
1506
+ import * as THREE from "three";
1507
+ import { Disposable } from "./interfaces";
1508
+ import { Event } from "./event";
1305
1509
  import { Components } from "../../Components";
1306
- /**
1307
- * Each of the planes created by {@link SimpleClipper}.
1308
- */
1309
- export declare class SimplePlane implements Disposable, Hideable {
1310
- /** Event that fires when the user starts dragging a clipping plane. */
1311
- readonly onDraggingStarted: Event<unknown>;
1312
- /** Event that fires when the user stops dragging a clipping plane. */
1313
- readonly onDraggingEnded: Event<unknown>;
1510
+ import { BaseWorldItem } from "./base-world-item";
1511
+ export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
1314
1512
  /** {@link Disposable.onDisposed} */
1315
1513
  readonly onDisposed: Event<unknown>;
1316
- readonly normal: THREE.Vector3;
1317
- readonly origin: THREE.Vector3;
1318
- readonly three: THREE.Plane;
1319
- protected readonly _helper: THREE.Object3D;
1320
- protected _visible: boolean;
1321
- protected _enabled: boolean;
1322
- components: Components;
1323
- world: World;
1324
- private _controlsActive;
1325
- private readonly _arrowBoundBox;
1326
- private readonly _planeMesh;
1327
- private readonly _controls;
1328
- private readonly _hiddenMaterial;
1329
- get enabled(): boolean;
1330
- /** {@link Component.enabled} */
1331
- set enabled(state: boolean);
1332
- /** {@link Hideable.visible } */
1333
- get visible(): boolean;
1334
- /** {@link Hideable.visible } */
1335
- set visible(state: boolean);
1336
- /** The meshes used for raycasting */
1337
- get meshes(): THREE.Mesh[];
1338
- /** The material of the clipping plane representation. */
1339
- get planeMaterial(): THREE.Material | THREE.Material[];
1340
- /** The material of the clipping plane representation. */
1341
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1342
- /** The size of the clipping plane representation. */
1343
- get size(): number;
1344
- /** Sets the size of the clipping plane representation. */
1345
- set size(size: number);
1346
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1347
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1348
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1349
- /** {@link Updateable.update} */
1350
- update: () => Promise<void>;
1514
+ abstract three: THREE.Object3D;
1515
+ protected constructor(components: Components);
1351
1516
  /** {@link Disposable.dispose} */
1352
1517
  dispose(): void;
1353
- private reset;
1354
- protected toggleControls(state: boolean): void;
1355
- private newTransformControls;
1356
- private initializeControls;
1357
- private createArrowBoundingBox;
1358
- private changeDrag;
1359
- private notifyDraggingChanged;
1360
- private preventCameraMovement;
1361
- private newHelper;
1362
- private static newPlaneMesh;
1363
1518
  }
1364
1519
  import * as THREE from "three";
1365
1520
  import { Disposable, Event } from "../../Types";
@@ -1388,40 +1543,168 @@ export declare class Mouse implements Disposable {
1388
1543
  private setupEvents;
1389
1544
  }
1390
1545
  import * as THREE from "three";
1546
+ import { BaseScene } from "./base-scene";
1547
+ import { BaseCamera } from "./base-camera";
1548
+ import { BaseRenderer } from "./base-renderer";
1549
+ import { Updateable, Disposable } from "./interfaces";
1550
+ export interface World extends Disposable, Updateable {
1551
+ meshes: Set<THREE.Mesh>;
1552
+ scene: BaseScene;
1553
+ camera: BaseCamera;
1554
+ renderer: BaseRenderer | null;
1555
+ uuid: string;
1556
+ }
1557
+ import { NavigationMode } from "./types";
1558
+ /**
1559
+ * A {@link NavigationMode} that allows first person navigation,
1560
+ * simulating FPS video games.
1561
+ */
1562
+ export declare class FirstPersonMode implements NavigationMode {
1563
+ private camera;
1564
+ /** {@link NavigationMode.enabled} */
1565
+ enabled: boolean;
1566
+ /** {@link NavigationMode.id} */
1567
+ readonly id = "FirstPerson";
1568
+ constructor(camera: any);
1569
+ /** {@link NavigationMode.set} */
1570
+ set(active: boolean): void;
1571
+ private setupFirstPersonCamera;
1572
+ }
1573
+ import * as THREE from "three";
1391
1574
  import { Components } from "../../Components";
1392
1575
  import { Event, World, Disposable } from "../../Types";
1393
1576
  import { Mouse } from "./mouse";
1394
1577
  /**
1395
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1396
- * that allows to easily get items from the scene using the mouse and touch
1397
- * events.
1578
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1579
+ * that allows to easily get items from the scene using the mouse and touch
1580
+ * events.
1581
+ */
1582
+ export declare class SimpleRaycaster implements Disposable {
1583
+ /** {@link Component.enabled} */
1584
+ enabled: boolean;
1585
+ components: Components;
1586
+ /** {@link Disposable.onDisposed} */
1587
+ readonly onDisposed: Event<unknown>;
1588
+ /** The position of the mouse in the screen. */
1589
+ readonly mouse: Mouse;
1590
+ readonly three: THREE.Raycaster;
1591
+ world: World;
1592
+ constructor(components: Components, world: World);
1593
+ /** {@link Disposable.dispose} */
1594
+ dispose(): void;
1595
+ /**
1596
+ * Throws a ray from the camera to the mouse or touch event point and returns
1597
+ * the first item found. This also takes into account the clipping planes
1598
+ * used by the renderer.
1599
+ *
1600
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1601
+ * to query. If not provided, it will query all the meshes stored in
1602
+ * {@link Components.meshes}.
1603
+ */
1604
+ castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
1605
+ 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;
1606
+ private intersect;
1607
+ private filterClippingPlanes;
1608
+ }
1609
+ import { NavigationMode } from "./types";
1610
+ /**
1611
+ * A {@link NavigationMode} that allows 3D navigation and panning
1612
+ * like in many 3D and CAD softwares.
1613
+ */
1614
+ export declare class OrbitMode implements NavigationMode {
1615
+ camera: any;
1616
+ /** {@link NavigationMode.enabled} */
1617
+ enabled: boolean;
1618
+ /** {@link NavigationMode.id} */
1619
+ readonly id = "Orbit";
1620
+ constructor(camera: any);
1621
+ /** {@link NavigationMode.set} */
1622
+ set(active: boolean): void;
1623
+ private activateOrbitControls;
1624
+ }
1625
+ import { NavigationMode } from "./types";
1626
+ /**
1627
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1628
+ * like many BIM tools.
1629
+ */
1630
+ export declare class PlanMode implements NavigationMode {
1631
+ private camera;
1632
+ /** {@link NavigationMode.enabled} */
1633
+ enabled: boolean;
1634
+ /** {@link NavigationMode.id} */
1635
+ readonly id = "Plan";
1636
+ private mouseAction1?;
1637
+ private mouseAction2?;
1638
+ private mouseInitialized;
1639
+ private readonly defaultAzimuthSpeed;
1640
+ private readonly defaultPolarSpeed;
1641
+ constructor(camera: any);
1642
+ /** {@link NavigationMode.set} */
1643
+ set(active: boolean): void;
1644
+ }
1645
+ import * as THREE from "three";
1646
+ import { CameraProjection } from "./types";
1647
+ import { Event } from "../../../core";
1648
+ import { OrthoPerspectiveCamera } from "../index";
1649
+ /**
1650
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1651
+ */
1652
+ export declare class ProjectionManager {
1653
+ /**
1654
+ * Event that fires when the {@link CameraProjection} changes.
1655
+ */
1656
+ readonly onChanged: Event<THREE.Camera>;
1657
+ current: CameraProjection;
1658
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1659
+ private _component;
1660
+ private _previousDistance;
1661
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
1662
+ matchOrthoDistanceEnabled: boolean;
1663
+ constructor(camera: OrthoPerspectiveCamera);
1664
+ /**
1665
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1666
+ *
1667
+ * @param projection - the new projection to set. If it is the current projection,
1668
+ * it will have no effect.
1669
+ */
1670
+ set(projection: CameraProjection): Promise<void>;
1671
+ /**
1672
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
1673
+ * and vice versa.
1674
+ */
1675
+ toggle(): Promise<void>;
1676
+ private setOrthoCamera;
1677
+ private getDims;
1678
+ private setupOrthoCamera;
1679
+ private getDistance;
1680
+ private setPerspectiveCamera;
1681
+ }
1682
+ /**
1683
+ * The projection system of the camera.
1684
+ */
1685
+ export type CameraProjection = "Perspective" | "Orthographic";
1686
+ /**
1687
+ * The extensible list of supported navigation modes.
1688
+ */
1689
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1690
+ /**
1691
+ * An object that determines the behavior of the camera controls
1692
+ * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1398
1693
  */
1399
- export declare class SimpleRaycaster implements Disposable {
1400
- /** {@link Component.enabled} */
1401
- enabled: boolean;
1402
- components: Components;
1403
- /** {@link Disposable.onDisposed} */
1404
- readonly onDisposed: Event<unknown>;
1405
- /** The position of the mouse in the screen. */
1406
- readonly mouse: Mouse;
1407
- readonly three: THREE.Raycaster;
1408
- world: World;
1409
- constructor(components: Components, world: World);
1410
- /** {@link Disposable.dispose} */
1411
- dispose(): void;
1694
+ export interface NavigationMode {
1695
+ /** The unique ID of this navigation mode. */
1696
+ id: NavModeID;
1412
1697
  /**
1413
- * Throws a ray from the camera to the mouse or touch event point and returns
1414
- * the first item found. This also takes into account the clipping planes
1415
- * used by the renderer.
1698
+ * Enable or disable this navigation mode.
1699
+ * When a new navigation mode is enabled, the previous navigation mode
1700
+ * must be disabled.
1416
1701
  *
1417
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1418
- * to query. If not provided, it will query all the meshes stored in
1419
- * {@link Components.meshes}.
1420
- */
1421
- castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
1422
- castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
1423
- private intersect;
1424
- private filterClippingPlanes;
1702
+ * @param active - whether to enable or disable this mode.
1703
+ * @param options - any additional data required to enable or disable it.
1704
+ * */
1705
+ set: (active: boolean, options?: any) => void;
1706
+ /** Whether this navigation mode is active or not. */
1707
+ enabled: boolean;
1425
1708
  }
1426
1709
  import * as THREE from "three";
1427
1710
  import { Components } from "../../Components";
@@ -1520,302 +1803,142 @@ export declare class MeshCullerRenderer extends CullerRenderer {
1520
1803
  }
1521
1804
  export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1522
1805
  import * as THREE from "three";
1523
- import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1524
- import { Components } from "../../Components";
1525
- export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
1526
- /**
1527
- * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
1528
- */
1529
- readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
1530
- readonly onAfterUpdate: Event<unknown>;
1531
- readonly onBeforeUpdate: Event<unknown>;
1532
- enabled: boolean;
1533
- uuid: string;
1534
- readonly onDisposed: Event<unknown>;
1535
- private _scene?;
1536
- private _camera?;
1537
- private _renderer;
1538
- get scene(): T;
1539
- set scene(scene: T);
1540
- get camera(): U;
1541
- set camera(camera: U);
1542
- get renderer(): S | null;
1543
- set renderer(renderer: S | null);
1544
- constructor(components: Components);
1545
- update(delta?: number): void;
1546
- dispose(disposeResources?: boolean): void;
1547
- }
1548
- import * as THREE from "three";
1549
- import { BaseScene, Configurable, Event } from "../../Types";
1550
- import { Components } from "../../Components";
1551
- export interface SimpleSceneConfig {
1552
- directionalLight: {
1553
- color: THREE.Color;
1554
- intensity: number;
1555
- position: THREE.Vector3;
1556
- };
1557
- ambientLight: {
1558
- color: THREE.Color;
1559
- intensity: number;
1560
- };
1561
- }
1562
- /**
1563
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1564
- * objects hierarchically, and easily dispose them when you are finished with it.
1565
- * @noInheritDoc
1566
- */
1567
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1568
- /** {@link Configurable.isSetup} */
1569
- isSetup: boolean;
1570
- three: THREE.Scene;
1571
- /** {@link Configurable.onSetup} */
1572
- readonly onSetup: Event<SimpleScene>;
1573
- config: Required<SimpleSceneConfig>;
1574
- constructor(components: Components);
1575
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1576
- setup(config?: Partial<SimpleSceneConfig>): void;
1577
- }
1578
- import * as THREE from "three";
1579
- import { BaseRenderer, Event } from "../../Types";
1580
- import { Components } from "../../Components";
1581
- /**
1582
- * A basic renderer capable of rendering
1583
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1584
- */
1585
- export declare class SimpleRenderer extends BaseRenderer {
1586
- /** {@link Component.enabled} */
1587
- enabled: boolean;
1588
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1589
- container: HTMLElement | null;
1590
- three: THREE.WebGLRenderer;
1591
- protected _canvas: HTMLCanvasElement;
1592
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1593
- protected onContainerUpdated: Event<HTMLElement>;
1594
- constructor(components: Components, container?: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1595
- /** {@link Updateable.update} */
1596
- update(): void;
1597
- /** {@link Disposable.dispose} */
1598
- dispose(): void;
1599
- /** {@link Resizeable.getSize}. */
1600
- getSize(): THREE.Vector2;
1601
- /** {@link Resizeable.resize} */
1602
- resize: (size?: THREE.Vector2) => void;
1603
- setupEvents(active: boolean): void;
1604
- private resizeEvent;
1605
- private setupRenderer;
1606
- private onContextLost;
1607
- private onContextBack;
1608
- private updateContainer;
1609
- }
1610
- import * as THREE from "three";
1611
- import CameraControls from "camera-controls";
1612
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1613
- import { Components } from "../../Components";
1614
- /**
1615
- * A basic camera that uses
1616
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1617
- * easily control the camera in 2D and 3D. Check out it's API to find out
1618
- * what features it offers.
1619
- */
1620
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1621
- /** {@link Updateable.onBeforeUpdate} */
1622
- readonly onBeforeUpdate: Event<SimpleCamera>;
1623
- /** {@link Updateable.onAfterUpdate} */
1624
- readonly onAfterUpdate: Event<SimpleCamera>;
1625
- readonly onAspectUpdated: Event<unknown>;
1626
- /** {@link Disposable.onDisposed} */
1627
- readonly onDisposed: Event<string>;
1628
- readonly three: THREE.PerspectiveCamera;
1629
- private _allControls;
1630
- /**
1631
- * The object that controls the camera. An instance of
1632
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1633
- * Transforming the camera directly will have no effect: you need to use this
1634
- * object to move, rotate, look at objects, etc.
1635
- */
1636
- get controls(): CameraControls;
1637
- /** {@link Component.enabled} */
1638
- get enabled(): boolean;
1639
- /** {@link Component.enabled} */
1640
- set enabled(enabled: boolean);
1641
- constructor(components: Components);
1642
- /** {@link Disposable.dispose} */
1643
- dispose(): void;
1644
- /** {@link Updateable.update} */
1645
- update(_delta: number): void;
1646
- /**
1647
- * Updates the aspect of the camera to match the size of the
1648
- * {@link Components.renderer}.
1649
- */
1650
- updateAspect: () => void;
1651
- private setupCamera;
1652
- private newCameraControls;
1653
- private setupEvents;
1654
- private static getSubsetOfThree;
1655
- }
1656
- /// <reference types="node" />
1657
- import * as THREE from "three";
1658
- import { Hideable, Event, World } from "../../Types";
1806
+ import { Hideable, Disposable, Event, World } from "../../Types";
1659
1807
  import { Components } from "../../Components";
1660
- export interface GridConfig {
1661
- color: THREE.Color;
1662
- size1: number;
1663
- size2: number;
1664
- distance: number;
1665
- }
1666
1808
  /**
1667
- * An infinite grid. Created by
1668
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1669
- * and translated to typescript by
1670
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1809
+ * Each of the planes created by {@link SimpleClipper}.
1671
1810
  */
1672
- export declare class SimpleGrid implements Hideable, Disposable {
1811
+ export declare class SimplePlane implements Disposable, Hideable {
1812
+ /** Event that fires when the user starts dragging a clipping plane. */
1813
+ readonly onDraggingStarted: Event<unknown>;
1814
+ /** Event that fires when the user stops dragging a clipping plane. */
1815
+ readonly onDraggingEnded: Event<unknown>;
1673
1816
  /** {@link Disposable.onDisposed} */
1674
1817
  readonly onDisposed: Event<unknown>;
1675
- world: World;
1818
+ readonly normal: THREE.Vector3;
1819
+ readonly origin: THREE.Vector3;
1820
+ readonly three: THREE.Plane;
1821
+ protected readonly _helper: THREE.Object3D;
1822
+ protected _visible: boolean;
1823
+ protected _enabled: boolean;
1676
1824
  components: Components;
1677
- /** {@link Hideable.visible} */
1825
+ world: World;
1826
+ private _controlsActive;
1827
+ private readonly _arrowBoundBox;
1828
+ private readonly _planeMesh;
1829
+ private readonly _controls;
1830
+ private readonly _hiddenMaterial;
1831
+ get enabled(): boolean;
1832
+ /** {@link Component.enabled} */
1833
+ set enabled(state: boolean);
1834
+ /** {@link Hideable.visible } */
1678
1835
  get visible(): boolean;
1679
- /** {@link Hideable.visible} */
1680
- set visible(visible: boolean);
1681
- /** The material of the grid. */
1682
- get material(): THREE.ShaderMaterial;
1683
- /**
1684
- * Whether the grid should fade away with distance. Recommended to be true for
1685
- * perspective cameras and false for orthographic cameras.
1686
- */
1687
- get fade(): boolean;
1688
- /**
1689
- * Whether the grid should fade away with distance. Recommended to be true for
1690
- * perspective cameras and false for orthographic cameras.
1691
- */
1692
- set fade(active: boolean);
1693
- private readonly _grid;
1694
- private _fade;
1695
- constructor(components: Components, world: World, config: GridConfig);
1696
- [Symbol.dispose](): void;
1697
- /** {@link Component.get} */
1698
- get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
1836
+ /** {@link Hideable.visible } */
1837
+ set visible(state: boolean);
1838
+ /** The meshes used for raycasting */
1839
+ get meshes(): THREE.Mesh[];
1840
+ /** The material of the clipping plane representation. */
1841
+ get planeMaterial(): THREE.Material | THREE.Material[];
1842
+ /** The material of the clipping plane representation. */
1843
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
1844
+ /** The size of the clipping plane representation. */
1845
+ get size(): number;
1846
+ /** Sets the size of the clipping plane representation. */
1847
+ set size(size: number);
1848
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1849
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1850
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
1851
+ /** {@link Updateable.update} */
1852
+ update: () => Promise<void>;
1699
1853
  /** {@link Disposable.dispose} */
1700
1854
  dispose(): void;
1701
- private setupEvents;
1702
- private updateZoom;
1855
+ private reset;
1856
+ protected toggleControls(state: boolean): void;
1857
+ private newTransformControls;
1858
+ private initializeControls;
1859
+ private createArrowBoundingBox;
1860
+ private changeDrag;
1861
+ private notifyDraggingChanged;
1862
+ private preventCameraMovement;
1863
+ private newHelper;
1864
+ private static newPlaneMesh;
1703
1865
  }
1704
- import { NavigationMode } from "./types";
1705
- /**
1706
- * A {@link NavigationMode} that allows 3D navigation and panning
1707
- * like in many 3D and CAD softwares.
1708
- */
1709
- export declare class OrbitMode implements NavigationMode {
1710
- camera: any;
1711
- /** {@link NavigationMode.enabled} */
1712
- enabled: boolean;
1713
- /** {@link NavigationMode.id} */
1714
- readonly id = "Orbit";
1715
- constructor(camera: any);
1716
- /** {@link NavigationMode.set} */
1717
- set(active: boolean): void;
1718
- private activateOrbitControls;
1866
+ import * as WEBIFC from "web-ifc";
1867
+ import * as THREE from "three";
1868
+ export declare class Units {
1869
+ factor: number;
1870
+ complement: number;
1871
+ apply(matrix: THREE.Matrix4): void;
1872
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1873
+ private getLengthUnits;
1874
+ private getScaleMatrix;
1719
1875
  }
1720
- import { NavigationMode } from "./types";
1721
- /**
1722
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1723
- * like many BIM tools.
1724
- */
1725
- export declare class PlanMode implements NavigationMode {
1726
- private camera;
1727
- /** {@link NavigationMode.enabled} */
1876
+ import * as WEBIFC from "web-ifc";
1877
+ import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1878
+ import { PropertiesStreamingSettings } from "./streaming-settings";
1879
+ export declare class FragmentPropsStreamConverter extends Component implements Disposable {
1880
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
1881
+ onPropertiesStreamed: AsyncEvent<{
1882
+ type: number;
1883
+ data: {
1884
+ [id: number]: any;
1885
+ };
1886
+ }>;
1887
+ onProgress: AsyncEvent<number>;
1888
+ onIndicesStreamed: AsyncEvent<number[][]>;
1889
+ /** {@link Disposable.onDisposed} */
1890
+ readonly onDisposed: Event<string>;
1728
1891
  enabled: boolean;
1729
- /** {@link NavigationMode.id} */
1730
- readonly id = "Plan";
1731
- private mouseAction1?;
1732
- private mouseAction2?;
1733
- private mouseInitialized;
1734
- private readonly defaultAzimuthSpeed;
1735
- private readonly defaultPolarSpeed;
1736
- constructor(camera: any);
1737
- /** {@link NavigationMode.set} */
1738
- set(active: boolean): void;
1892
+ settings: PropertiesStreamingSettings;
1893
+ webIfc: WEBIFC.IfcAPI;
1894
+ dispose(): Promise<void>;
1895
+ streamFromBuffer(data: Uint8Array): Promise<void>;
1896
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
1897
+ private readIfcFile;
1898
+ private streamIfcFile;
1899
+ private streamAllProperties;
1900
+ private getIndices;
1901
+ private cleanUp;
1739
1902
  }
1740
- import { NavigationMode } from "./types";
1741
- /**
1742
- * A {@link NavigationMode} that allows first person navigation,
1743
- * simulating FPS video games.
1744
- */
1745
- export declare class FirstPersonMode implements NavigationMode {
1746
- private camera;
1747
- /** {@link NavigationMode.enabled} */
1748
- enabled: boolean;
1749
- /** {@link NavigationMode.id} */
1750
- readonly id = "FirstPerson";
1751
- constructor(camera: any);
1752
- /** {@link NavigationMode.set} */
1753
- set(active: boolean): void;
1754
- private setupFirstPersonCamera;
1903
+ export interface StreamedGeometries {
1904
+ [id: number]: {
1905
+ boundingBox: Float32Array;
1906
+ hasHoles: boolean;
1907
+ geometryFile?: string;
1908
+ };
1909
+ }
1910
+ export interface StreamedAsset {
1911
+ id: number;
1912
+ geometries: {
1913
+ geometryID: number;
1914
+ transformation: number[];
1915
+ color: number[];
1916
+ }[];
1755
1917
  }
1756
1918
  import * as THREE from "three";
1757
- import { CameraProjection } from "./types";
1758
- import { Event } from "../../../core";
1759
- import { OrthoPerspectiveCamera } from "../index";
1760
- /**
1761
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1762
- */
1763
- export declare class ProjectionManager {
1764
- /**
1765
- * Event that fires when the {@link CameraProjection} changes.
1766
- */
1767
- readonly onChanged: Event<THREE.Camera>;
1768
- current: CameraProjection;
1769
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1770
- private _component;
1771
- private _previousDistance;
1772
- /** Match Ortho zoom with Perspective distance when changing projection mode */
1773
- matchOrthoDistanceEnabled: boolean;
1774
- constructor(camera: OrthoPerspectiveCamera);
1775
- /**
1776
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1777
- *
1778
- * @param projection - the new projection to set. If it is the current projection,
1779
- * it will have no effect.
1780
- */
1781
- set(projection: CameraProjection): Promise<void>;
1782
- /**
1783
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
1784
- * and vice versa.
1785
- */
1786
- toggle(): Promise<void>;
1787
- private setOrthoCamera;
1788
- private getDims;
1789
- private setupOrthoCamera;
1790
- private getDistance;
1791
- private setPerspectiveCamera;
1919
+ import * as WEBIFC from "web-ifc";
1920
+ import * as FRAGS from "@thatopen/fragments";
1921
+ export declare class CivilReader {
1922
+ defLineMat: THREE.LineBasicMaterial;
1923
+ read(webIfc: WEBIFC.IfcAPI): {
1924
+ alignments: Map<number, FRAGS.Alignment>;
1925
+ coordinationMatrix: THREE.Matrix4;
1926
+ } | undefined;
1927
+ get(civilItems: any): {
1928
+ alignments: Map<number, FRAGS.Alignment>;
1929
+ coordinationMatrix: THREE.Matrix4;
1930
+ } | undefined;
1931
+ private getCurves;
1792
1932
  }
1793
- /**
1794
- * The projection system of the camera.
1795
- */
1796
- export type CameraProjection = "Perspective" | "Orthographic";
1797
- /**
1798
- * The extensible list of supported navigation modes.
1799
- */
1800
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1801
- /**
1802
- * An object that determines the behavior of the camera controls
1803
- * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1804
- */
1805
- export interface NavigationMode {
1806
- /** The unique ID of this navigation mode. */
1807
- id: NavModeID;
1808
- /**
1809
- * Enable or disable this navigation mode.
1810
- * When a new navigation mode is enabled, the previous navigation mode
1811
- * must be disabled.
1812
- *
1813
- * @param active - whether to enable or disable this mode.
1814
- * @param options - any additional data required to enable or disable it.
1815
- * */
1816
- set: (active: boolean, options?: any) => void;
1817
- /** Whether this navigation mode is active or not. */
1818
- enabled: boolean;
1933
+ import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
1934
+ /** Configuration of the IFC-fragment streaming. */
1935
+ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1936
+ minGeometrySize: number;
1937
+ minAssetsSize: number;
1938
+ }
1939
+ /** Configuration of the IFC-fragment streaming. */
1940
+ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1941
+ propertiesSize: number;
1819
1942
  }
1820
1943
  import * as WEBIFC from "web-ifc";
1821
1944
  /** Configuration of the IFC-fragment conversion. */
@@ -1848,31 +1971,30 @@ import * as WEBIFC from "web-ifc";
1848
1971
  export declare class IfcMetadataReader {
1849
1972
  get(webIfc: WEBIFC.IfcAPI, type: number): string;
1850
1973
  }
1851
- import * as THREE from "three";
1852
- import * as WEBIFC from "web-ifc";
1853
- import * as FRAGS from "@thatopen/fragments";
1854
- export declare class CivilReader {
1855
- defLineMat: THREE.LineBasicMaterial;
1856
- read(webIfc: WEBIFC.IfcAPI): {
1857
- alignments: Map<number, FRAGS.Alignment>;
1858
- coordinationMatrix: THREE.Matrix4;
1859
- } | undefined;
1860
- get(civilItems: any): {
1861
- alignments: Map<number, FRAGS.Alignment>;
1862
- coordinationMatrix: THREE.Matrix4;
1863
- } | undefined;
1864
- private getCurves;
1865
- }
1866
- import * as WEBIFC from "web-ifc";
1867
- import * as THREE from "three";
1868
- export declare class Units {
1869
- factor: number;
1870
- complement: number;
1871
- apply(matrix: THREE.Matrix4): void;
1872
- setUp(webIfc: WEBIFC.IfcAPI): void;
1873
- private getLengthUnits;
1874
- private getScaleMatrix;
1974
+ export type RelationsMap = Map<number, Map<number, number[]>>;
1975
+ export interface ModelsRelationMap {
1976
+ [modelID: string]: RelationsMap;
1875
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];
1876
1998
  import { BufferGeometry } from "three";
1877
1999
  import * as THREE from "three";
1878
2000
  export declare class TransformHelper {
@@ -1901,54 +2023,5 @@ export interface Query {
1901
2023
  description?: string;
1902
2024
  groups: QueryGroup;
1903
2025
  }
1904
- import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
1905
- import { MiniMap } from "./src";
1906
- export declare class MiniMaps extends Component implements Updateable, Disposable {
1907
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
1908
- readonly onAfterUpdate: Event<unknown>;
1909
- readonly onBeforeUpdate: Event<unknown>;
1910
- readonly onDisposed: Event<unknown>;
1911
- enabled: boolean;
1912
- list: Map<string, MiniMap>;
1913
- constructor(components: Components);
1914
- create(world: World): MiniMap;
1915
- delete(id: string): void;
1916
- dispose(): void | Promise<void>;
1917
- update(): void;
1918
- }
1919
- import * as THREE from "three";
1920
- import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
1921
- export declare class MiniMap implements Resizeable, Updateable, Disposable {
1922
- /** {@link Disposable.onDisposed} */
1923
- readonly onDisposed: Event<unknown>;
1924
- readonly onAfterUpdate: Event<unknown>;
1925
- readonly onBeforeUpdate: Event<unknown>;
1926
- readonly onResize: Event<THREE.Vector2>;
1927
- frontOffset: number;
1928
- overrideMaterial: THREE.MeshDepthMaterial;
1929
- backgroundColor: THREE.Color;
1930
- renderer: THREE.WebGLRenderer;
1931
- enabled: boolean;
1932
- world: World;
1933
- private _lockRotation;
1934
- private _camera;
1935
- private _plane;
1936
- private _size;
1937
- private _tempVector1;
1938
- private _tempVector2;
1939
- private _tempTarget;
1940
- private readonly down;
1941
- get lockRotation(): boolean;
1942
- set lockRotation(active: boolean);
1943
- get zoom(): number;
1944
- set zoom(value: number);
1945
- constructor(world: World);
1946
- dispose(): void;
1947
- get(): THREE.OrthographicCamera;
1948
- update(): void;
1949
- getSize(): THREE.Vector2;
1950
- resize(size?: THREE.Vector2): void;
1951
- private updatePlanes;
1952
- }
1953
2026
 
1954
2027
  }