@thatopen/components 2.0.5 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,157 @@
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, 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
+ private _inverseAttributes;
21
+ private _ifcRels;
22
+ /**
23
+ * Holds the relationship mappings for each model processed by the indexer.
24
+ * The structure is a map where each key is a model's UUID, and the value is another map.
25
+ * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
26
+ * representing a specific relation type, and the value is an array of expressIDs of entities
27
+ * that are related through that relation type. This structure allows for efficient querying
28
+ * of entity relationships within a model.
29
+ */
30
+ readonly relationMaps: ModelsRelationMap;
31
+ constructor(components: Components);
32
+ private onFragmentsDisposed;
33
+ /**
34
+ * Adds a relation map to the model's relations map.
35
+ *
36
+ * @param model - The 'FragmentsGroup' model to which the relation map will be added.
37
+ * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
38
+ *
39
+ * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
40
+ */
41
+ setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
42
+ /**
43
+ * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
44
+ * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
45
+ * and maps them in a structured way to facilitate quick access to related entities.
46
+ *
47
+ * The process involves querying the model for each relation type associated with the inverse attributes
48
+ * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
49
+ * and contains a nested map where each key is an entity's expressID and its value is another map.
50
+ * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
51
+ * of entities that are related through that attribute.
52
+ *
53
+ * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
54
+ * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
55
+ * representation of the relations indexed by entity expressIDs and relation types.
56
+ * @throws An error if the model does not have properties loaded.
57
+ */
58
+ process(model: FragmentsGroup): Promise<RelationsMap>;
59
+ /**
60
+ * Processes a given model from a WebIfc API to index its IFC entities relations.
61
+ *
62
+ * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
63
+ * @param modelID - The unique identifier of the model within the WebIfc API.
64
+ * @returns A promise that resolves to the relations map for the processed model.
65
+ * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
66
+ */
67
+ processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
68
+ /**
69
+ * Retrieves the relations of a specific entity within a model based on the given relation name.
70
+ * This method searches the indexed relation maps for the specified model and entity,
71
+ * returning the IDs of related entities if a match is found.
72
+ *
73
+ * @param model The 'FragmentsGroup' model containing the entity.
74
+ * @param expressID The unique identifier of the entity within the model.
75
+ * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
76
+ * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
77
+ * or the specified relation name is not indexed.
78
+ */
79
+ getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
80
+ /**
81
+ * Serializes the relations of a given relation map into a JSON string.
82
+ * 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,
83
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
84
+ * The resulting object is then serialized into a JSON string.
85
+ *
86
+ * @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.
87
+ * @returns A JSON string representing the serialized relations of the given relation map.
88
+ */
89
+ serializeRelations(relationMap: RelationsMap): string;
90
+ /**
91
+ * Serializes the relations of a specific model into a JSON string.
92
+ * This method iterates through the relations indexed for the given model,
93
+ * organizing them into a structured object where each key is an expressID of an entity,
94
+ * and its value is another object mapping relation indices to arrays of related entity expressIDs.
95
+ * The resulting object is then serialized into a JSON string.
96
+ *
97
+ * @param model The 'FragmentsGroup' model whose relations are to be serialized.
98
+ * @returns A JSON string representing the serialized relations of the specified model.
99
+ * If the model has no indexed relations, 'null' is returned.
100
+ */
101
+ serializeModelRelations(model: FragmentsGroup): string | null;
102
+ /**
103
+ * Serializes all relations of every model processed by the indexer into a JSON string.
104
+ * This method iterates through each model's relations indexed in 'relationMaps', organizing them
105
+ * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
106
+ * and its value is another object mapping entity expressIDs to their related entities, categorized
107
+ * by relation types. The structure facilitates easy access to any entity's relations across all models.
108
+ *
109
+ * @returns A JSON string representing the serialized relations of all models processed by the indexer.
110
+ * If no relations have been indexed, an empty object is returned as a JSON string.
111
+ */
112
+ serializeAllRelations(): string;
113
+ /**
114
+ * Converts a JSON string representing relations between entities into a structured map.
115
+ * This method parses the JSON string to reconstruct the relations map that indexes
116
+ * entity relations by their express IDs. The outer map keys are the express IDs of entities,
117
+ * and the values are maps where each key is a relation type ID and its value is an array
118
+ * of express IDs of entities related through that relation type.
119
+ *
120
+ * @param json The JSON string to be parsed into the relations map.
121
+ * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
122
+ * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
123
+ * is an array of express IDs (as numbers) of entities related through that relation type.
124
+ */
125
+ getRelationsMapFromJSON(json: string): RelationsMap;
126
+ /**
127
+ * Disposes the component, cleaning up resources and detaching event listeners.
128
+ * This ensures that the component is properly cleaned up and does not leave behind any
129
+ * references that could prevent garbage collection.
130
+ */
131
+ dispose(): void;
132
+ }
133
+ export type { InverseAttribute, RelationsMap } from "./src/types";
134
+ import * as WEBIFC from "web-ifc";
135
+ import * as FRAG from "@thatopen/fragments";
136
+ import { Component, Components } from "../../core";
137
+ /**
138
+ * Object to export all the properties from an IFC to a JS object.
139
+ */
140
+ export declare class IfcJsonExporter extends Component {
141
+ static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
142
+ /** {@link Component.enabled} */
143
+ enabled: boolean;
144
+ constructor(components: Components);
145
+ /**
146
+ * Exports all the properties of an IFC into an array of JS objects.
147
+ * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
148
+ * @param modelID ID of the IFC model whose properties to extract.
149
+ * @param indirect whether to get the indirect relationships as well.
150
+ * @param recursiveSpatial whether to get the properties of spatial items recursively
151
+ * to make the location data available (e.g. absolute position of building).
152
+ */
153
+ export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
154
+ }
2
155
  import { Component, Disposable, World, Event } from "../Types";
3
156
  import { SimpleRaycaster } from "./src";
4
157
  import { Components } from "../Components";
@@ -12,21 +165,78 @@ export declare class Raycasters extends Component implements Disposable {
12
165
  delete(world: World): void;
13
166
  dispose(): void;
14
167
  }
15
- import { Component, Disposable, World, Event } from "../Types";
16
- import { GridConfig, SimpleGrid } from "./src";
17
- import { Components } from "../Components";
18
- export declare class Grids extends Component implements Disposable {
19
- static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
20
- list: Map<string, SimpleGrid>;
21
- readonly onDisposed: Event<unknown>;
22
- config: Required<GridConfig>;
23
- /** {@link Component.enabled} */
168
+ import * as WEBIFC from "web-ifc";
169
+ import { FragmentsGroup } from "@thatopen/fragments";
170
+ import { Component, Disposable, Event, Components } from "../../core";
171
+ type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
172
+ type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
173
+ type NumericPropTypes = "IfcInteger" | "IfcReal";
174
+ interface ChangeMap {
175
+ [modelID: string]: Set<number>;
176
+ }
177
+ interface AttributeListener {
178
+ [modelID: string]: {
179
+ [expressID: number]: {
180
+ [attributeName: string]: Event<String | Boolean | Number>;
181
+ };
182
+ };
183
+ }
184
+ export declare class IfcPropertiesManager extends Component implements Disposable {
185
+ static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
186
+ /** {@link Disposable.onDisposed} */
187
+ readonly onDisposed: Event<string>;
188
+ readonly onRequestFile: Event<unknown>;
189
+ ifcToExport: ArrayBuffer | null;
190
+ readonly onElementToPset: Event<{
191
+ model: FragmentsGroup;
192
+ psetID: number;
193
+ elementID: number;
194
+ }>;
195
+ readonly onPropToPset: Event<{
196
+ model: FragmentsGroup;
197
+ psetID: number;
198
+ propID: number;
199
+ }>;
200
+ readonly onPsetRemoved: Event<{
201
+ model: FragmentsGroup;
202
+ psetID: number;
203
+ }>;
204
+ readonly onDataChanged: Event<{
205
+ model: FragmentsGroup;
206
+ expressID: number;
207
+ }>;
208
+ wasm: {
209
+ path: string;
210
+ absolute: boolean;
211
+ };
24
212
  enabled: boolean;
213
+ attributeListeners: AttributeListener;
214
+ selectedModel?: FragmentsGroup;
215
+ changeMap: ChangeMap;
25
216
  constructor(components: Components);
26
- create(world: World): SimpleGrid;
27
- delete(world: World): void;
28
217
  dispose(): void;
218
+ private increaseMaxID;
219
+ static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
220
+ private newGUID;
221
+ private getOwnerHistory;
222
+ private registerChange;
223
+ setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
224
+ newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
225
+ pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
226
+ rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
227
+ }>;
228
+ removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
229
+ private newSingleProperty;
230
+ newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
231
+ newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
232
+ newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
233
+ removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
234
+ addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
235
+ addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
236
+ saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
237
+ setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
29
238
  }
239
+ export {};
30
240
  import { Component, Disposable, Event } from "../Types";
31
241
  /**
32
242
  * The entry point of the Components library.
@@ -79,24 +289,75 @@ export declare class Components implements Disposable {
79
289
  private update;
80
290
  private static setupBVH;
81
291
  }
82
- import { MiniMap } from "./src";
83
- import { Component, Updateable, World, Event, Disposable } from "../Types";
292
+ import * as THREE from "three";
84
293
  import { Components } from "../Components";
85
- export declare class MiniMaps extends Component implements Updateable, Disposable {
86
- static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
87
- readonly onAfterUpdate: Event<unknown>;
88
- readonly onBeforeUpdate: Event<unknown>;
89
- readonly onDisposed: Event<unknown>;
294
+ import { Component } from "../Types";
295
+ /**
296
+ * A tool to safely remove meshes and geometries from memory to
297
+ * [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
298
+ */
299
+ export declare class Disposer extends Component {
300
+ private _disposedComponents;
301
+ /** {@link Component.enabled} */
90
302
  enabled: boolean;
91
- list: Map<string, MiniMap>;
303
+ static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
92
304
  constructor(components: Components);
93
- create(world: World): MiniMap;
94
- delete(id: string): void;
95
- dispose(): void;
96
- update(): void;
97
- }
98
- import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
99
- import { Components } from "../Components";
305
+ /**
306
+ * {@link Component.uuid}.
307
+ * @return the list of UUIDs of deleted components.
308
+ */
309
+ get(): Set<string>;
310
+ /**
311
+ * Removes a mesh, its geometry and its materials from memory. If you are
312
+ * using any of these in other parts of the application, make sure that you
313
+ * remove them from the mesh before disposing it.
314
+ *
315
+ * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
316
+ * to remove.
317
+ *
318
+ * @param materials - whether to dispose the materials of the mesh.
319
+ *
320
+ * @param recursive - whether to recursively dispose the children of the mesh.
321
+ */
322
+ destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
323
+ /**
324
+ * Disposes a geometry from memory.
325
+ *
326
+ * @param geometry - the
327
+ * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
328
+ * to remove.
329
+ */
330
+ disposeGeometry(geometry: THREE.BufferGeometry): void;
331
+ private disposeGeometryAndMaterials;
332
+ private disposeChildren;
333
+ private static disposeMaterial;
334
+ }
335
+ import * as THREE from "three";
336
+ import { Component, Components } from "../../core";
337
+ export interface MeasureEdge {
338
+ distance: number;
339
+ points: THREE.Vector3[];
340
+ }
341
+ export declare class MeasurementUtils extends Component {
342
+ enabled: boolean;
343
+ static uuid: string;
344
+ constructor(components: Components);
345
+ getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
346
+ edges: MeasureEdge[];
347
+ indices: Set<number>;
348
+ } | null;
349
+ static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
350
+ private getFaceData;
351
+ getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
352
+ p1: THREE.Vector3;
353
+ p2: THREE.Vector3;
354
+ p3: THREE.Vector3;
355
+ faceNormal: THREE.Vector3;
356
+ };
357
+ private round;
358
+ }
359
+ import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
360
+ import { Components } from "../Components";
100
361
  import { SimpleWorld } from "./src";
101
362
  export declare class Worlds extends Component implements Updateable, Disposable {
102
363
  /**
@@ -146,160 +407,53 @@ export declare class Worlds extends Component implements Updateable, Disposable
146
407
  dispose(): void;
147
408
  update(delta?: number): void | Promise<void>;
148
409
  }
410
+ export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
149
411
  import * as THREE from "three";
150
- import { Components } from "../Components";
151
- import { SimpleCamera } from "..";
152
- import { NavigationMode, NavModeID, ProjectionManager } from "./src";
153
- /**
154
- * A flexible camera that uses
155
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
156
- * easily control the camera in 2D and 3D. It supports multiple navigation
157
- * modes, such as 2D floor plan navigation, first person and 3D orbit.
158
- */
159
- export declare class OrthoPerspectiveCamera extends SimpleCamera {
160
- /**
161
- * The current {@link NavigationMode}.
162
- */
163
- _mode: NavigationMode | null;
164
- readonly projection: ProjectionManager;
165
- readonly threeOrtho: THREE.OrthographicCamera;
166
- readonly threePersp: THREE.PerspectiveCamera;
167
- protected readonly _userInputButtons: any;
168
- protected readonly _frustumSize = 50;
169
- protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
170
- private previousSize;
171
- get mode(): NavigationMode;
172
- constructor(components: Components);
173
- /** {@link Disposable.dispose} */
174
- dispose(): void;
175
- /**
176
- * Sets a new {@link NavigationMode} and disables the previous one.
177
- *
178
- * @param mode - The {@link NavigationMode} to set.
179
- */
180
- set(mode: NavModeID): void;
181
- /**
182
- * Make the camera view fit all the specified meshes.
183
- *
184
- * @param meshes the meshes to fit. If it is not defined, it will
185
- * evaluate {@link Components.meshes}.
186
- * @param offset the distance to the fit object
187
- */
188
- fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
189
- /**
190
- * Allows or prevents all user input.
191
- *
192
- * @param active - whether to enable or disable user inputs.
193
- */
194
- setUserInput(active: boolean): void;
195
- private disableUserInput;
196
- private enableUserInput;
197
- private newOrthoCamera;
198
- private setOrthoPerspCameraAspect;
412
+ export declare function obbFromPoints(vertices: ArrayLike<number>): {
413
+ center: THREE.Vector3;
414
+ halfSizes: THREE.Vector3;
415
+ rotation: THREE.Matrix3;
416
+ transformation: THREE.Matrix4;
417
+ };
418
+ import * as THREE from "three";
419
+ export declare class MaterialsUtils {
420
+ static isTransparent(material: THREE.Material): boolean;
421
+ }
422
+ export declare class UUID {
423
+ private static _pattern;
424
+ private static _lut;
425
+ static create(): string;
426
+ static validate(uuid: string): void;
199
427
  }
200
428
  import * as THREE from "three";
201
- import { Components } from "../Components";
202
- import { Component } from "../Types";
203
- /**
204
- * A tool to safely remove meshes and geometries from memory to
205
- * [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
206
- */
207
- export declare class Disposer extends Component {
208
- private _disposedComponents;
209
- /** {@link Component.enabled} */
210
- enabled: boolean;
211
- static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
212
- constructor(components: Components);
213
- /**
214
- * {@link Component.uuid}.
215
- * @return the list of UUIDs of deleted components.
216
- */
217
- get(): Set<string>;
218
- /**
219
- * Removes a mesh, its geometry and its materials from memory. If you are
220
- * using any of these in other parts of the application, make sure that you
221
- * remove them from the mesh before disposing it.
222
- *
223
- * @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
224
- * to remove.
225
- *
226
- * @param materials - whether to dispose the materials of the mesh.
227
- *
228
- * @param recursive - whether to recursively dispose the children of the mesh.
229
- */
230
- destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
231
- /**
232
- * Disposes a geometry from memory.
233
- *
234
- * @param geometry - the
235
- * [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
236
- * to remove.
237
- */
238
- disposeGeometry(geometry: THREE.BufferGeometry): void;
239
- private disposeGeometryAndMaterials;
240
- private disposeChildren;
241
- private static disposeMaterial;
429
+ import { Component, Components, Event, World } from "../core";
430
+ export interface VertexPickerConfig {
431
+ showOnlyVertex: boolean;
432
+ snapDistance: number;
433
+ previewElement: HTMLElement;
242
434
  }
243
- import { Components } from "../Components";
244
- import { MeshCullerRenderer, CullerRendererSettings } from "./src";
245
- import { Component, Event, Disposable, World } from "../Types";
246
- /**
247
- * A tool to handle big scenes efficiently by automatically hiding the objects
248
- * that are not visible to the camera.
249
- */
250
- export declare class Cullers extends Component implements Disposable {
251
- /**
252
- * A unique identifier for the Cullers component.
253
- */
254
- static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
255
- /**
256
- * Indicates whether the Cullers component is enabled.
257
- */
435
+ export declare class VertexPicker extends Component {
436
+ onVertexFound: Event<THREE.Vector3>;
437
+ onVertexLost: Event<THREE.Vector3>;
438
+ components: Components;
439
+ private _pickedPoint;
440
+ private _config;
258
441
  private _enabled;
259
- /**
260
- * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
261
- */
262
- list: Map<string, MeshCullerRenderer>;
263
- /**
264
- * An event that is triggered when the Cullers component is disposed.
265
- */
266
- readonly onDisposed: Event<unknown>;
267
- /**
268
- * Gets the enabled state of the Cullers component.
269
- *
270
- * @returns The current enabled state.
271
- */
272
- get enabled(): boolean;
273
- /**
274
- * Sets the enabled state of the Cullers component.
275
- * Also sets the enabled state of all MeshCullerRenderer instances.
276
- *
277
- * @param value - The new enabled state.
278
- */
442
+ private _workingPlane;
279
443
  set enabled(value: boolean);
280
- constructor(components: Components);
281
- /**
282
- * Creates a new MeshCullerRenderer for the given world.
283
- * If a MeshCullerRenderer already exists for the world, it will return the existing one.
284
- *
285
- * @param world - The world for which to create the MeshCullerRenderer.
286
- * @param config - Optional configuration settings for the MeshCullerRenderer.
287
- *
288
- * @returns The newly created or existing MeshCullerRenderer for the given world.
289
- */
290
- create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
291
- delete(world: World): void;
292
- /** {@link Disposable.dispose} */
444
+ get enabled(): boolean;
445
+ constructor(components: Components, config?: Partial<VertexPickerConfig>);
446
+ set workingPlane(plane: THREE.Plane | null);
447
+ get workingPlane(): THREE.Plane | null;
448
+ set config(value: Partial<VertexPickerConfig>);
449
+ get config(): Partial<VertexPickerConfig>;
293
450
  dispose(): void;
451
+ get(world: World): THREE.Vector3 | null;
452
+ private getClosestVertex;
453
+ private getVertices;
454
+ private getVertex;
294
455
  }
295
456
  import * as THREE from "three";
296
- export declare function obbFromPoints(vertices: ArrayLike<number>): {
297
- center: THREE.Vector3;
298
- halfSizes: THREE.Vector3;
299
- rotation: THREE.Matrix3;
300
- transformation: THREE.Matrix4;
301
- };
302
- import * as THREE from "three";
303
457
  import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
304
458
  import { SimplePlane } from "./src";
305
459
  import { Components } from "../Components";
@@ -398,288 +552,140 @@ export declare class Clipper extends Component implements Createable, Disposable
398
552
  private _onStartDragging;
399
553
  private _onEndDragging;
400
554
  }
401
- export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
402
- import * as THREE from "three";
403
- export declare class MaterialsUtils {
404
- static isTransparent(material: THREE.Material): boolean;
405
- }
406
- import * as THREE from "three";
407
- import { Component, Components, Event, World } from "../core";
408
- export interface VertexPickerConfig {
409
- showOnlyVertex: boolean;
410
- snapDistance: number;
411
- previewElement: HTMLElement;
412
- }
413
- export declare class VertexPicker extends Component {
414
- onVertexFound: Event<THREE.Vector3>;
415
- onVertexLost: Event<THREE.Vector3>;
416
- components: Components;
417
- private _pickedPoint;
418
- private _config;
419
- private _enabled;
420
- private _workingPlane;
421
- set enabled(value: boolean);
422
- get enabled(): boolean;
423
- constructor(components: Components, config?: Partial<VertexPickerConfig>);
424
- set workingPlane(plane: THREE.Plane | null);
425
- get workingPlane(): THREE.Plane | null;
426
- set config(value: Partial<VertexPickerConfig>);
427
- get config(): Partial<VertexPickerConfig>;
428
- dispose(): void;
429
- get(world: World): THREE.Vector3 | null;
430
- private getClosestVertex;
431
- private getVertices;
432
- private getVertex;
433
- }
434
- import * as THREE from "three";
435
- import { Component, Components } from "../../core";
436
- export interface MeasureEdge {
437
- distance: number;
438
- points: THREE.Vector3[];
439
- }
440
- export declare class MeasurementUtils extends Component {
555
+ import { Component, Disposable, World, Event } from "../Types";
556
+ import { GridConfig, SimpleGrid } from "./src";
557
+ import { Components } from "../Components";
558
+ export declare class Grids extends Component implements Disposable {
559
+ static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
560
+ list: Map<string, SimpleGrid>;
561
+ readonly onDisposed: Event<unknown>;
562
+ config: Required<GridConfig>;
563
+ /** {@link Component.enabled} */
441
564
  enabled: boolean;
442
- static uuid: string;
443
565
  constructor(components: Components);
444
- getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
445
- edges: MeasureEdge[];
446
- indices: Set<number>;
447
- } | null;
448
- static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
449
- private getFaceData;
450
- getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
451
- p1: THREE.Vector3;
452
- p2: THREE.Vector3;
453
- p3: THREE.Vector3;
454
- faceNormal: THREE.Vector3;
455
- };
456
- private round;
566
+ create(world: World): SimpleGrid;
567
+ delete(world: World): void;
568
+ dispose(): void;
457
569
  }
458
- import * as WEBIFC from "web-ifc";
459
- import * as FRAG from "@thatopen/fragments";
460
- import { Component, Components } from "../../core";
570
+ import { Components } from "../Components";
571
+ import { MeshCullerRenderer, CullerRendererSettings } from "./src";
572
+ import { Component, Event, Disposable, World } from "../Types";
461
573
  /**
462
- * Object to export all the properties from an IFC to a JS object.
574
+ * A tool to handle big scenes efficiently by automatically hiding the objects
575
+ * that are not visible to the camera.
463
576
  */
464
- export declare class IfcJsonExporter extends Component {
465
- static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
466
- /** {@link Component.enabled} */
467
- enabled: boolean;
468
- constructor(components: Components);
577
+ export declare class Cullers extends Component implements Disposable {
469
578
  /**
470
- * Exports all the properties of an IFC into an array of JS objects.
471
- * @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
472
- * @param modelID ID of the IFC model whose properties to extract.
473
- * @param indirect whether to get the indirect relationships as well.
474
- * @param recursiveSpatial whether to get the properties of spatial items recursively
475
- * to make the location data available (e.g. absolute position of building).
579
+ * A unique identifier for the Cullers component.
476
580
  */
477
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
478
- }
479
- import * as WEBIFC from "web-ifc";
480
- import { FragmentsGroup } from "@thatopen/fragments";
481
- import { Disposable, Event, Component, Components } from "../../core";
482
- import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
483
- /**
484
- * Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
485
- * 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.
486
- */
487
- export declare class IfcRelationsIndexer extends Component implements Disposable {
488
- static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
489
- /** {@link Disposable.onDisposed} */
490
- readonly onDisposed: Event<string>;
491
- enabled: boolean;
492
- readonly onRelationsIndexed: Event<{
493
- modelID: string;
494
- relationsMap: RelationsMap;
495
- }>;
496
- private _relToAttributesMap;
497
- private _inverseAttributes;
498
- private _ifcRels;
581
+ static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
499
582
  /**
500
- * Holds the relationship mappings for each model processed by the indexer.
501
- * The structure is a map where each key is a model's UUID, and the value is another map.
502
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
503
- * representing a specific relation type, and the value is an array of expressIDs of entities
504
- * that are related through that relation type. This structure allows for efficient querying
505
- * of entity relationships within a model.
583
+ * Indicates whether the Cullers component is enabled.
506
584
  */
507
- readonly relationMaps: ModelsRelationMap;
508
- constructor(components: Components);
509
- private onFragmentsDisposed;
585
+ private _enabled;
510
586
  /**
511
- * Adds a relation map to the model's relations map.
512
- *
513
- * @param model - The 'FragmentsGroup' model to which the relation map will be added.
514
- * @param relationMap - The 'RelationsMap' to be added to the model's relations map.
515
- *
516
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
587
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
517
588
  */
518
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
589
+ list: Map<string, MeshCullerRenderer>;
519
590
  /**
520
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
521
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
522
- * and maps them in a structured way to facilitate quick access to related entities.
523
- *
524
- * The process involves querying the model for each relation type associated with the inverse attributes
525
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
526
- * and contains a nested map where each key is an entity's expressID and its value is another map.
527
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
528
- * of entities that are related through that attribute.
529
- *
530
- * @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
531
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
532
- * representation of the relations indexed by entity expressIDs and relation types.
533
- * @throws An error if the model does not have properties loaded.
591
+ * An event that is triggered when the Cullers component is disposed.
534
592
  */
535
- process(model: FragmentsGroup): Promise<RelationsMap>;
593
+ readonly onDisposed: Event<unknown>;
536
594
  /**
537
- * Processes a given model from a WebIfc API to index its IFC entities relations.
595
+ * Gets the enabled state of the Cullers component.
538
596
  *
539
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
540
- * @param modelID - The unique identifier of the model within the WebIfc API.
541
- * @returns A promise that resolves to the relations map for the processed model.
542
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
597
+ * @returns The current enabled state.
543
598
  */
544
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
599
+ get enabled(): boolean;
545
600
  /**
546
- * Retrieves the relations of a specific entity within a model based on the given relation name.
547
- * This method searches the indexed relation maps for the specified model and entity,
548
- * returning the IDs of related entities if a match is found.
601
+ * Sets the enabled state of the Cullers component.
602
+ * Also sets the enabled state of all MeshCullerRenderer instances.
549
603
  *
550
- * @param model The 'FragmentsGroup' model containing the entity.
551
- * @param expressID The unique identifier of the entity within the model.
552
- * @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
553
- * @returns An array of express IDs representing the related entities, or 'null' if no relations are found
554
- * or the specified relation name is not indexed.
604
+ * @param value - The new enabled state.
555
605
  */
556
- getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
606
+ set enabled(value: boolean);
607
+ constructor(components: Components);
557
608
  /**
558
- * Serializes the relations of a given relation map into a JSON string.
559
- * 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,
560
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
561
- * The resulting object is then serialized into a JSON string.
562
- *
563
- * @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.
564
- * @returns A JSON string representing the serialized relations of the given relation map.
609
+ * Creates a new MeshCullerRenderer for the given world.
610
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
611
+ *
612
+ * @param world - The world for which to create the MeshCullerRenderer.
613
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
614
+ *
615
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
616
+ */
617
+ create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
618
+ delete(world: World): void;
619
+ /** {@link Disposable.dispose} */
620
+ dispose(): void;
621
+ }
622
+ import { MiniMap } from "./src";
623
+ import { Component, Updateable, World, Event, Disposable } from "../Types";
624
+ import { Components } from "../Components";
625
+ export declare class MiniMaps extends Component implements Updateable, Disposable {
626
+ static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
627
+ readonly onAfterUpdate: Event<unknown>;
628
+ readonly onBeforeUpdate: Event<unknown>;
629
+ readonly onDisposed: Event<unknown>;
630
+ enabled: boolean;
631
+ list: Map<string, MiniMap>;
632
+ constructor(components: Components);
633
+ create(world: World): MiniMap;
634
+ delete(id: string): void;
635
+ dispose(): void;
636
+ update(): void;
637
+ }
638
+ import * as THREE from "three";
639
+ import { Components } from "../Components";
640
+ import { SimpleCamera } from "..";
641
+ import { NavigationMode, NavModeID, ProjectionManager } from "./src";
642
+ /**
643
+ * A flexible camera that uses
644
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
645
+ * easily control the camera in 2D and 3D. It supports multiple navigation
646
+ * modes, such as 2D floor plan navigation, first person and 3D orbit.
647
+ */
648
+ export declare class OrthoPerspectiveCamera extends SimpleCamera {
649
+ /**
650
+ * The current {@link NavigationMode}.
565
651
  */
566
- serializeRelations(relationMap: RelationsMap): string;
652
+ _mode: NavigationMode | null;
653
+ readonly projection: ProjectionManager;
654
+ readonly threeOrtho: THREE.OrthographicCamera;
655
+ readonly threePersp: THREE.PerspectiveCamera;
656
+ protected readonly _userInputButtons: any;
657
+ protected readonly _frustumSize = 50;
658
+ protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
659
+ private previousSize;
660
+ get mode(): NavigationMode;
661
+ constructor(components: Components);
662
+ /** {@link Disposable.dispose} */
663
+ dispose(): void;
567
664
  /**
568
- * Serializes the relations of a specific model into a JSON string.
569
- * This method iterates through the relations indexed for the given model,
570
- * organizing them into a structured object where each key is an expressID of an entity,
571
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
572
- * The resulting object is then serialized into a JSON string.
665
+ * Sets a new {@link NavigationMode} and disables the previous one.
573
666
  *
574
- * @param model The 'FragmentsGroup' model whose relations are to be serialized.
575
- * @returns A JSON string representing the serialized relations of the specified model.
576
- * If the model has no indexed relations, 'null' is returned.
667
+ * @param mode - The {@link NavigationMode} to set.
577
668
  */
578
- serializeModelRelations(model: FragmentsGroup): string | null;
669
+ set(mode: NavModeID): void;
579
670
  /**
580
- * Serializes all relations of every model processed by the indexer into a JSON string.
581
- * This method iterates through each model's relations indexed in 'relationMaps', organizing them
582
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
583
- * and its value is another object mapping entity expressIDs to their related entities, categorized
584
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
671
+ * Make the camera view fit all the specified meshes.
585
672
  *
586
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
587
- * If no relations have been indexed, an empty object is returned as a JSON string.
673
+ * @param meshes the meshes to fit. If it is not defined, it will
674
+ * evaluate {@link Components.meshes}.
675
+ * @param offset the distance to the fit object
588
676
  */
589
- serializeAllRelations(): string;
677
+ fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
590
678
  /**
591
- * Converts a JSON string representing relations between entities into a structured map.
592
- * This method parses the JSON string to reconstruct the relations map that indexes
593
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
594
- * and the values are maps where each key is a relation type ID and its value is an array
595
- * of express IDs of entities related through that relation type.
679
+ * Allows or prevents all user input.
596
680
  *
597
- * @param json The JSON string to be parsed into the relations map.
598
- * @returns A 'Map' where the key is the express ID of an entity as a number, and the value
599
- * is another 'Map'. This inner map's key is the relation type ID as a number, and its value
600
- * is an array of express IDs (as numbers) of entities related through that relation type.
681
+ * @param active - whether to enable or disable user inputs.
601
682
  */
602
- getRelationsMapFromJSON(json: string): RelationsMap;
603
- /**
604
- * Disposes the component, cleaning up resources and detaching event listeners.
605
- * This ensures that the component is properly cleaned up and does not leave behind any
606
- * references that could prevent garbage collection.
607
- */
608
- dispose(): void;
609
- }
610
- export type { InverseAttribute } from "./src/types";
611
- import * as WEBIFC from "web-ifc";
612
- import { FragmentsGroup } from "@thatopen/fragments";
613
- import { Component, Disposable, Event, Components } from "../../core";
614
- type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
615
- type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
616
- type NumericPropTypes = "IfcInteger" | "IfcReal";
617
- interface ChangeMap {
618
- [modelID: string]: Set<number>;
619
- }
620
- interface AttributeListener {
621
- [modelID: string]: {
622
- [expressID: number]: {
623
- [attributeName: string]: Event<String | Boolean | Number>;
624
- };
625
- };
626
- }
627
- export declare class IfcPropertiesManager extends Component implements Disposable {
628
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
629
- /** {@link Disposable.onDisposed} */
630
- readonly onDisposed: Event<string>;
631
- readonly onRequestFile: Event<unknown>;
632
- ifcToExport: ArrayBuffer | null;
633
- readonly onElementToPset: Event<{
634
- model: FragmentsGroup;
635
- psetID: number;
636
- elementID: number;
637
- }>;
638
- readonly onPropToPset: Event<{
639
- model: FragmentsGroup;
640
- psetID: number;
641
- propID: number;
642
- }>;
643
- readonly onPsetRemoved: Event<{
644
- model: FragmentsGroup;
645
- psetID: number;
646
- }>;
647
- readonly onDataChanged: Event<{
648
- model: FragmentsGroup;
649
- expressID: number;
650
- }>;
651
- wasm: {
652
- path: string;
653
- absolute: boolean;
654
- };
655
- enabled: boolean;
656
- attributeListeners: AttributeListener;
657
- selectedModel?: FragmentsGroup;
658
- changeMap: ChangeMap;
659
- constructor(components: Components);
660
- dispose(): void;
661
- private increaseMaxID;
662
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
663
- private newGUID;
664
- private getOwnerHistory;
665
- private registerChange;
666
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
667
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
668
- pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
669
- rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
670
- }>;
671
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
672
- private newSingleProperty;
673
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
674
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
675
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
676
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
677
- addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
678
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
679
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
680
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
683
+ setUserInput(active: boolean): void;
684
+ private disableUserInput;
685
+ private enableUserInput;
686
+ private newOrthoCamera;
687
+ private setOrthoPerspCameraAspect;
681
688
  }
682
- export {};
683
689
  import * as THREE from "three";
684
690
  import * as FRAGS from "@thatopen/fragments";
685
691
  import { FragmentsGroup } from "@thatopen/fragments";
@@ -760,65 +766,47 @@ export declare class Exploder extends Component implements Disposable {
760
766
  dispose(): void;
761
767
  set(active: boolean): void;
762
768
  }
763
- import * as FRAGS from "@thatopen/fragments";
764
- import { Components, Component } from "../../core";
765
- export declare class Hider extends Component {
766
- static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
767
- enabled: boolean;
768
- constructor(components: Components);
769
- set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
770
- isolate(items: FRAGS.FragmentIdMap): void;
771
- private updateCulledVisibility;
772
- }
773
- export declare class UUID {
774
- private static _pattern;
775
- private static _lut;
776
- static create(): string;
777
- static validate(uuid: string): void;
778
- }
779
769
  import * as WEBIFC from "web-ifc";
780
- import { Components, Disposable, Event, Component } from "../../core";
781
- import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
782
- export declare class IfcGeometryTiler extends Component implements Disposable {
783
- static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
784
- onGeometryStreamed: Event<{
785
- buffer: Uint8Array;
786
- data: StreamedGeometries;
787
- }>;
788
- onAssetStreamed: Event<StreamedAsset[]>;
789
- onProgress: Event<number>;
790
- onIfcLoaded: Event<Uint8Array>;
770
+ import * as FRAGS from "@thatopen/fragments";
771
+ import { IfcFragmentSettings } from "./src";
772
+ import { Component, Components, Event, Disposable } from "../../core";
773
+ export declare class IfcLoader extends Component implements Disposable {
774
+ static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
775
+ readonly onIfcStartedLoading: Event<void>;
776
+ readonly onSetup: Event<void>;
791
777
  /** {@link Disposable.onDisposed} */
792
- readonly onDisposed: Event<unknown>;
793
- settings: IfcStreamingSettings;
778
+ readonly onDisposed: Event<string>;
779
+ settings: IfcFragmentSettings;
794
780
  enabled: boolean;
795
781
  webIfc: WEBIFC.IfcAPI;
782
+ private _material;
796
783
  private _spatialTree;
797
784
  private _metaData;
798
- private _visitedGeometries;
799
- private _streamSerializer;
800
- private _geometries;
801
- private _geometryCount;
785
+ private _fragmentInstances;
802
786
  private _civil;
803
- private _groupSerializer;
804
- private _assets;
805
- private _meshesWithHoles;
787
+ private _visitedFragments;
788
+ private _materialT;
806
789
  constructor(components: Components);
807
790
  dispose(): void;
808
- streamFromBuffer(data: Uint8Array): Promise<void>;
809
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
810
- private readIfcFile;
811
- private streamIfcFile;
812
- private streamAllGeometries;
813
- private cleanUp;
791
+ setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
792
+ load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
793
+ readIfcFile(data: Uint8Array): Promise<number>;
794
+ private getAllGeometries;
795
+ cleanUp(): void;
814
796
  private getMesh;
815
797
  private getGeometry;
816
- private streamAssets;
817
- private streamGeometries;
798
+ private autoSetWasm;
799
+ }
800
+ import * as FRAGS from "@thatopen/fragments";
801
+ import { Components, Component } from "../../core";
802
+ export declare class Hider extends Component {
803
+ static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
804
+ enabled: boolean;
805
+ constructor(components: Components);
806
+ set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
807
+ isolate(items: FRAGS.FragmentIdMap): void;
808
+ private updateCulledVisibility;
818
809
  }
819
- export declare const IfcCategoryMap: {
820
- [key: number]: string;
821
- };
822
810
  import { Fragment, FragmentsGroup } from "@thatopen/fragments";
823
811
  import * as THREE from "three";
824
812
  import * as FRAGS from "@thatopen/fragments";
@@ -860,6 +848,7 @@ export declare class FragmentsManager extends Component implements Disposable {
860
848
  */
861
849
  load(data: Uint8Array, config?: Partial<{
862
850
  coordinate: boolean;
851
+ name: string;
863
852
  properties: FRAGS.IfcProperties;
864
853
  relationsMap: RelationsMap;
865
854
  }>): FragmentsGroup;
@@ -871,32 +860,6 @@ export declare class FragmentsManager extends Component implements Disposable {
871
860
  export(group: FragmentsGroup): Uint8Array;
872
861
  coordinate(models?: FragmentsGroup[]): void;
873
862
  }
874
- import * as WEBIFC from "web-ifc";
875
- import { AsyncEvent, Component, Disposable, Event } from "../../core";
876
- import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
877
- export declare class IfcPropertiesTiler extends Component implements Disposable {
878
- static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
879
- onPropertiesStreamed: AsyncEvent<{
880
- type: number;
881
- data: {
882
- [id: number]: any;
883
- };
884
- }>;
885
- onProgress: AsyncEvent<number>;
886
- onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
887
- /** {@link Disposable.onDisposed} */
888
- readonly onDisposed: Event<string>;
889
- enabled: boolean;
890
- settings: PropertiesStreamingSettings;
891
- webIfc: WEBIFC.IfcAPI;
892
- dispose(): Promise<void>;
893
- streamFromBuffer(data: Uint8Array): Promise<void>;
894
- streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
895
- private readIfcFile;
896
- private streamIfcFile;
897
- private streamAllProperties;
898
- private cleanUp;
899
- }
900
863
  export declare const IfcElements: {
901
864
  [key: number]: string;
902
865
  };
@@ -932,48 +895,86 @@ export declare class IfcPropertiesUtils {
932
895
  static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
933
896
  static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
934
897
  }
898
+ export declare const IfcCategoryMap: {
899
+ [key: number]: string;
900
+ };
901
+ export declare const GeometryTypes: Set<number>;
935
902
  import * as WEBIFC from "web-ifc";
936
- import * as FRAGS from "@thatopen/fragments";
937
- import { IfcFragmentSettings } from "./src";
938
- import { Component, Components, Event, Disposable } from "../../core";
939
- export declare class IfcLoader extends Component implements Disposable {
940
- static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
941
- readonly onIfcStartedLoading: Event<void>;
942
- readonly onSetup: Event<void>;
903
+ import { Components, Disposable, Event, Component } from "../../core";
904
+ import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
905
+ export declare class IfcGeometryTiler extends Component implements Disposable {
906
+ static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
907
+ onGeometryStreamed: Event<{
908
+ buffer: Uint8Array;
909
+ data: StreamedGeometries;
910
+ }>;
911
+ onAssetStreamed: Event<StreamedAsset[]>;
912
+ onProgress: Event<number>;
913
+ onIfcLoaded: Event<Uint8Array>;
943
914
  /** {@link Disposable.onDisposed} */
944
- readonly onDisposed: Event<string>;
945
- settings: IfcFragmentSettings;
915
+ readonly onDisposed: Event<unknown>;
916
+ settings: IfcStreamingSettings;
946
917
  enabled: boolean;
947
918
  webIfc: WEBIFC.IfcAPI;
948
- private _material;
949
919
  private _spatialTree;
950
920
  private _metaData;
951
- private _fragmentInstances;
921
+ private _visitedGeometries;
922
+ private _streamSerializer;
923
+ private _geometries;
924
+ private _geometryCount;
952
925
  private _civil;
953
- private _visitedFragments;
954
- private _materialT;
926
+ private _groupSerializer;
927
+ private _assets;
928
+ private _meshesWithHoles;
955
929
  constructor(components: Components);
956
930
  dispose(): void;
957
- setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
958
- load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
959
- readIfcFile(data: Uint8Array): Promise<number>;
960
- private getAllGeometries;
961
- cleanUp(): void;
931
+ streamFromBuffer(data: Uint8Array): Promise<void>;
932
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
933
+ private readIfcFile;
934
+ private streamIfcFile;
935
+ private streamAllGeometries;
936
+ private cleanUp;
962
937
  private getMesh;
963
938
  private getGeometry;
964
- private autoSetWasm;
939
+ private streamAssets;
940
+ private streamGeometries;
965
941
  }
966
- export declare const GeometryTypes: Set<number>;
967
- import { InverseAttribute } from "./types";
968
- export declare const relToAttributesMap: Map<number, {
969
- forRelating: InverseAttribute;
970
- forRelated: InverseAttribute;
971
- }>;
972
- import * as THREE from "three";
973
- import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
974
- export declare class MiniMap implements Resizeable, Updateable, Disposable {
942
+ import * as WEBIFC from "web-ifc";
943
+ import { AsyncEvent, Component, Disposable, Event } from "../../core";
944
+ import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
945
+ export declare class IfcPropertiesTiler extends Component implements Disposable {
946
+ static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
947
+ onPropertiesStreamed: AsyncEvent<{
948
+ type: number;
949
+ data: {
950
+ [id: number]: any;
951
+ };
952
+ }>;
953
+ onProgress: AsyncEvent<number>;
954
+ onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
975
955
  /** {@link Disposable.onDisposed} */
976
- readonly onDisposed: Event<unknown>;
956
+ readonly onDisposed: Event<string>;
957
+ enabled: boolean;
958
+ settings: PropertiesStreamingSettings;
959
+ webIfc: WEBIFC.IfcAPI;
960
+ dispose(): Promise<void>;
961
+ streamFromBuffer(data: Uint8Array): Promise<void>;
962
+ streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
963
+ private readIfcFile;
964
+ private streamIfcFile;
965
+ private streamAllProperties;
966
+ private cleanUp;
967
+ }
968
+ import { InverseAttribute } from "./types";
969
+ export declare const relToAttributesMap: Map<number, {
970
+ forRelating: InverseAttribute;
971
+ forRelated: InverseAttribute;
972
+ }>;
973
+ import * as THREE from "three";
974
+ import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
975
+ export declare class MiniMap implements Resizeable, Updateable, Disposable {
976
+ /** {@link Disposable.onDisposed} */
977
+ readonly onDisposed: Event<unknown>;
977
978
  readonly onAfterUpdate: Event<unknown>;
978
979
  readonly onBeforeUpdate: Event<unknown>;
979
980
  readonly onResize: Event<THREE.Vector2>;
@@ -1011,78 +1012,6 @@ export declare class SpatialStructure {
1011
1012
  setUp(webIfc: WEBIFC.IfcAPI): void;
1012
1013
  cleanUp(): void;
1013
1014
  }
1014
- /// <reference types="node" />
1015
- import * as THREE from "three";
1016
- import { Hideable, Event, World } from "../../Types";
1017
- import { Components } from "../../Components";
1018
- export interface GridConfig {
1019
- color: THREE.Color;
1020
- size1: number;
1021
- size2: number;
1022
- distance: number;
1023
- }
1024
- /**
1025
- * An infinite grid. Created by
1026
- * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1027
- * and translated to typescript by
1028
- * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1029
- */
1030
- export declare class SimpleGrid implements Hideable, Disposable {
1031
- /** {@link Disposable.onDisposed} */
1032
- readonly onDisposed: Event<unknown>;
1033
- world: World;
1034
- components: Components;
1035
- /** {@link Hideable.visible} */
1036
- get visible(): boolean;
1037
- /** {@link Hideable.visible} */
1038
- set visible(visible: boolean);
1039
- /** The material of the grid. */
1040
- get material(): THREE.ShaderMaterial;
1041
- /**
1042
- * Whether the grid should fade away with distance. Recommended to be true for
1043
- * perspective cameras and false for orthographic cameras.
1044
- */
1045
- get fade(): boolean;
1046
- /**
1047
- * Whether the grid should fade away with distance. Recommended to be true for
1048
- * perspective cameras and false for orthographic cameras.
1049
- */
1050
- set fade(active: boolean);
1051
- readonly three: THREE.Mesh;
1052
- private _fade;
1053
- constructor(components: Components, world: World, config: GridConfig);
1054
- [Symbol.dispose](): void;
1055
- /** {@link Disposable.dispose} */
1056
- dispose(): void;
1057
- private setupEvents;
1058
- private updateZoom;
1059
- }
1060
- import * as THREE from "three";
1061
- import { Disposable, Event } from "../../Types";
1062
- /**
1063
- * A helper to easily get the real position of the mouse in the Three.js canvas
1064
- * to work with tools like the
1065
- * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1066
- * been transformed through CSS or doesn't occupy the whole screen.
1067
- */
1068
- export declare class Mouse implements Disposable {
1069
- dom: HTMLCanvasElement;
1070
- private _event?;
1071
- private _position;
1072
- /** {@link Disposable.onDisposed} */
1073
- readonly onDisposed: Event<unknown>;
1074
- constructor(dom: HTMLCanvasElement);
1075
- /**
1076
- * The real position of the mouse of the Three.js canvas.
1077
- */
1078
- get position(): THREE.Vector2;
1079
- /** {@link Disposable.dispose} */
1080
- dispose(): void;
1081
- private getPositionY;
1082
- private getPositionX;
1083
- private updateMouseInfo;
1084
- private setupEvents;
1085
- }
1086
1015
  /**
1087
1016
  * Simple event handler by
1088
1017
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -1118,42 +1047,6 @@ export declare class AsyncEvent<T> {
1118
1047
  private handlers;
1119
1048
  }
1120
1049
  import * as THREE from "three";
1121
- import { Components } from "../../Components";
1122
- import { Event, World, Disposable } from "../../Types";
1123
- import { Mouse } from "./mouse";
1124
- /**
1125
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1126
- * that allows to easily get items from the scene using the mouse and touch
1127
- * events.
1128
- */
1129
- export declare class SimpleRaycaster implements Disposable {
1130
- /** {@link Component.enabled} */
1131
- enabled: boolean;
1132
- components: Components;
1133
- /** {@link Disposable.onDisposed} */
1134
- readonly onDisposed: Event<unknown>;
1135
- /** The position of the mouse in the screen. */
1136
- readonly mouse: Mouse;
1137
- readonly three: THREE.Raycaster;
1138
- world: World;
1139
- constructor(components: Components, world: World);
1140
- /** {@link Disposable.dispose} */
1141
- dispose(): void;
1142
- /**
1143
- * Throws a ray from the camera to the mouse or touch event point and returns
1144
- * the first item found. This also takes into account the clipping planes
1145
- * used by the renderer.
1146
- *
1147
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1148
- * to query. If not provided, it will query all the meshes stored in
1149
- * {@link Components.meshes}.
1150
- */
1151
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1152
- 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;
1153
- private intersect;
1154
- private filterClippingPlanes;
1155
- }
1156
- import * as THREE from "three";
1157
1050
  import CameraControls from "camera-controls";
1158
1051
  import { Event } from "./event";
1159
1052
  /**
@@ -1276,6 +1169,24 @@ export interface BVHGeometry extends THREE.BufferGeometry {
1276
1169
  export interface CameraControllable {
1277
1170
  controls: CameraControls;
1278
1171
  }
1172
+ import { Base } from "./base";
1173
+ /**
1174
+ * Components are the building blocks of this library. Components are singleton
1175
+ * elements that contain specific functionality. For instance, the SimpleClipper
1176
+ * Component can create, delete and handle 3D clipping planes. Components must be
1177
+ * unique (they can't be instanced more than once), and have a static UUID that
1178
+ * identifies them uniquely. The can be accessed globally using the {@link Components}
1179
+ * instance.
1180
+ */
1181
+ export declare abstract class Component extends Base {
1182
+ /**
1183
+ * Whether this component is active or not. The behaviour can vary depending
1184
+ * on the type of component. E.g. a disabled dimension tool will stop creating
1185
+ * dimensions, while a disabled camera will stop moving. A disabled component
1186
+ * will not be updated automatically each frame.
1187
+ */
1188
+ abstract enabled: boolean;
1189
+ }
1279
1190
  /**
1280
1191
  * Simple event handler by
1281
1192
  * [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
@@ -1310,24 +1221,6 @@ export declare class Event<T> {
1310
1221
  reset(): void;
1311
1222
  private handlers;
1312
1223
  }
1313
- import { Base } from "./base";
1314
- /**
1315
- * Components are the building blocks of this library. Components are singleton
1316
- * elements that contain specific functionality. For instance, the SimpleClipper
1317
- * Component can create, delete and handle 3D clipping planes. Components must be
1318
- * unique (they can't be instanced more than once), and have a static UUID that
1319
- * identifies them uniquely. The can be accessed globally using the {@link Components}
1320
- * instance.
1321
- */
1322
- export declare abstract class Component extends Base {
1323
- /**
1324
- * Whether this component is active or not. The behaviour can vary depending
1325
- * on the type of component. E.g. a disabled dimension tool will stop creating
1326
- * dimensions, while a disabled camera will stop moving. A disabled component
1327
- * will not be updated automatically each frame.
1328
- */
1329
- abstract enabled: boolean;
1330
- }
1331
1224
  import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
1332
1225
  import { Components } from "../../Components";
1333
1226
  /**
@@ -1442,6 +1335,36 @@ export interface World extends Disposable, Updateable {
1442
1335
  isDisposing: boolean;
1443
1336
  }
1444
1337
  import * as THREE from "three";
1338
+ import { BaseScene, Configurable, Event } from "../../Types";
1339
+ import { Components } from "../../Components";
1340
+ export interface SimpleSceneConfig {
1341
+ directionalLight: {
1342
+ color: THREE.Color;
1343
+ intensity: number;
1344
+ position: THREE.Vector3;
1345
+ };
1346
+ ambientLight: {
1347
+ color: THREE.Color;
1348
+ intensity: number;
1349
+ };
1350
+ }
1351
+ /**
1352
+ * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1353
+ * objects hierarchically, and easily dispose them when you are finished with it.
1354
+ * @noInheritDoc
1355
+ */
1356
+ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1357
+ /** {@link Configurable.isSetup} */
1358
+ isSetup: boolean;
1359
+ three: THREE.Scene;
1360
+ /** {@link Configurable.onSetup} */
1361
+ readonly onSetup: Event<SimpleScene>;
1362
+ config: Required<SimpleSceneConfig>;
1363
+ constructor(components: Components);
1364
+ /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1365
+ setup(config?: Partial<SimpleSceneConfig>): void;
1366
+ }
1367
+ import * as THREE from "three";
1445
1368
  import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
1446
1369
  import { Components } from "../../Components";
1447
1370
  export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
@@ -1470,50 +1393,307 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
1470
1393
  dispose(disposeResources?: boolean): void;
1471
1394
  }
1472
1395
  import * as THREE from "three";
1473
- import CameraControls from "camera-controls";
1474
- import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1396
+ import { BaseRenderer, Event } from "../../Types";
1397
+ import { Components } from "../../Components";
1398
+ /**
1399
+ * A basic renderer capable of rendering
1400
+ * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1401
+ */
1402
+ export declare class SimpleRenderer extends BaseRenderer {
1403
+ enabled: boolean;
1404
+ /** The HTML container of the THREE.js canvas where the scene is rendered. */
1405
+ container: HTMLElement;
1406
+ three: THREE.WebGLRenderer;
1407
+ protected _canvas: HTMLCanvasElement;
1408
+ protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1409
+ protected _resizeObserver: ResizeObserver | null;
1410
+ protected onContainerUpdated: Event<unknown>;
1411
+ private _resizing;
1412
+ constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1413
+ /** {@link Updateable.update} */
1414
+ update(): void;
1415
+ /** {@link Disposable.dispose} */
1416
+ dispose(): void;
1417
+ /** {@link Resizeable.getSize}. */
1418
+ getSize(): THREE.Vector2;
1419
+ /** {@link Resizeable.resize} */
1420
+ resize: (size?: THREE.Vector2) => void;
1421
+ setupEvents(active: boolean): void;
1422
+ private resizeEvent;
1423
+ private setupRenderer;
1424
+ private onContextLost;
1425
+ private onContextBack;
1426
+ }
1427
+ import * as THREE from "three";
1428
+ import { Hideable, Event, World, Disposable } from "../../Types";
1429
+ import { Components } from "../../Components";
1430
+ export interface GridConfig {
1431
+ color: THREE.Color;
1432
+ size1: number;
1433
+ size2: number;
1434
+ distance: number;
1435
+ }
1436
+ /**
1437
+ * An infinite grid. Created by
1438
+ * [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
1439
+ * and translated to typescript by
1440
+ * [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
1441
+ */
1442
+ export declare class SimpleGrid implements Hideable, Disposable {
1443
+ /** {@link Disposable.onDisposed} */
1444
+ readonly onDisposed: Event<unknown>;
1445
+ world: World;
1446
+ components: Components;
1447
+ /** {@link Hideable.visible} */
1448
+ get visible(): boolean;
1449
+ /** {@link Hideable.visible} */
1450
+ set visible(visible: boolean);
1451
+ /** The material of the grid. */
1452
+ get material(): THREE.ShaderMaterial;
1453
+ /**
1454
+ * Whether the grid should fade away with distance. Recommended to be true for
1455
+ * perspective cameras and false for orthographic cameras.
1456
+ */
1457
+ get fade(): boolean;
1458
+ /**
1459
+ * Whether the grid should fade away with distance. Recommended to be true for
1460
+ * perspective cameras and false for orthographic cameras.
1461
+ */
1462
+ set fade(active: boolean);
1463
+ readonly three: THREE.Mesh;
1464
+ private _fade;
1465
+ constructor(components: Components, world: World, config: GridConfig);
1466
+ /** {@link Disposable.dispose} */
1467
+ dispose(): void;
1468
+ private setupEvents;
1469
+ private updateZoom;
1470
+ }
1471
+ import * as THREE from "three";
1472
+ import CameraControls from "camera-controls";
1473
+ import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
1474
+ import { Components } from "../../Components";
1475
+ /**
1476
+ * A basic camera that uses
1477
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1478
+ * easily control the camera in 2D and 3D. Check out it's API to find out
1479
+ * what features it offers.
1480
+ */
1481
+ export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1482
+ /** {@link Updateable.onBeforeUpdate} */
1483
+ readonly onBeforeUpdate: Event<SimpleCamera>;
1484
+ /** {@link Updateable.onAfterUpdate} */
1485
+ readonly onAfterUpdate: Event<SimpleCamera>;
1486
+ readonly onAspectUpdated: Event<unknown>;
1487
+ /** {@link Disposable.onDisposed} */
1488
+ readonly onDisposed: Event<string>;
1489
+ three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1490
+ private _allControls;
1491
+ /**
1492
+ * The object that controls the camera. An instance of
1493
+ * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1494
+ * Transforming the camera directly will have no effect: you need to use this
1495
+ * object to move, rotate, look at objects, etc.
1496
+ */
1497
+ get controls(): CameraControls;
1498
+ /** {@link Component.enabled} */
1499
+ get enabled(): boolean;
1500
+ /** {@link Component.enabled} */
1501
+ set enabled(enabled: boolean);
1502
+ constructor(components: Components);
1503
+ /** {@link Disposable.dispose} */
1504
+ dispose(): void;
1505
+ /** {@link Updateable.update} */
1506
+ update(_delta: number): void;
1507
+ /**
1508
+ * Updates the aspect of the camera to match the size of the
1509
+ * {@link Components.renderer}.
1510
+ */
1511
+ updateAspect: () => void;
1512
+ private setupCamera;
1513
+ private newCameraControls;
1514
+ private setupEvents;
1515
+ private static getSubsetOfThree;
1516
+ }
1517
+ import { NavigationMode } from "./types";
1518
+ import { OrthoPerspectiveCamera } from "../index";
1519
+ /**
1520
+ * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1521
+ * like many BIM tools.
1522
+ */
1523
+ export declare class PlanMode implements NavigationMode {
1524
+ private camera;
1525
+ /** {@link NavigationMode.enabled} */
1526
+ enabled: boolean;
1527
+ /** {@link NavigationMode.id} */
1528
+ readonly id = "Plan";
1529
+ private mouseAction1?;
1530
+ private mouseAction2?;
1531
+ private mouseInitialized;
1532
+ private readonly defaultAzimuthSpeed;
1533
+ private readonly defaultPolarSpeed;
1534
+ constructor(camera: OrthoPerspectiveCamera);
1535
+ /** {@link NavigationMode.set} */
1536
+ set(active: boolean): void;
1537
+ }
1538
+ import { NavigationMode } from "./types";
1539
+ import { OrthoPerspectiveCamera } from "../index";
1540
+ /**
1541
+ * A {@link NavigationMode} that allows 3D navigation and panning
1542
+ * like in many 3D and CAD softwares.
1543
+ */
1544
+ export declare class OrbitMode implements NavigationMode {
1545
+ camera: OrthoPerspectiveCamera;
1546
+ /** {@link NavigationMode.enabled} */
1547
+ enabled: boolean;
1548
+ /** {@link NavigationMode.id} */
1549
+ readonly id = "Orbit";
1550
+ constructor(camera: OrthoPerspectiveCamera);
1551
+ /** {@link NavigationMode.set} */
1552
+ set(active: boolean): void;
1553
+ private activateOrbitControls;
1554
+ }
1555
+ import { NavigationMode } from "./types";
1556
+ import { OrthoPerspectiveCamera } from "../index";
1557
+ /**
1558
+ * A {@link NavigationMode} that allows first person navigation,
1559
+ * simulating FPS video games.
1560
+ */
1561
+ export declare class FirstPersonMode implements NavigationMode {
1562
+ private camera;
1563
+ /** {@link NavigationMode.enabled} */
1564
+ enabled: boolean;
1565
+ /** {@link NavigationMode.id} */
1566
+ readonly id = "FirstPerson";
1567
+ constructor(camera: OrthoPerspectiveCamera);
1568
+ /** {@link NavigationMode.set} */
1569
+ set(active: boolean): void;
1570
+ private setupFirstPersonCamera;
1571
+ }
1572
+ import * as THREE from "three";
1573
+ import { CameraProjection } from "./types";
1574
+ import { Event } from "../../Types";
1575
+ import { OrthoPerspectiveCamera } from "../index";
1576
+ /**
1577
+ * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1578
+ */
1579
+ export declare class ProjectionManager {
1580
+ /**
1581
+ * Event that fires when the {@link CameraProjection} changes.
1582
+ */
1583
+ readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1584
+ current: CameraProjection;
1585
+ camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1586
+ private _component;
1587
+ private _previousDistance;
1588
+ /** Match Ortho zoom with Perspective distance when changing projection mode */
1589
+ matchOrthoDistanceEnabled: boolean;
1590
+ constructor(camera: OrthoPerspectiveCamera);
1591
+ /**
1592
+ * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1593
+ *
1594
+ * @param projection - the new projection to set. If it is the current projection,
1595
+ * it will have no effect.
1596
+ */
1597
+ set(projection: CameraProjection): Promise<void>;
1598
+ /**
1599
+ * Changes the current {@link CameraProjection} from Ortographic to Perspective
1600
+ * and vice versa.
1601
+ */
1602
+ toggle(): Promise<void>;
1603
+ private setOrthoCamera;
1604
+ private getPerspectiveDims;
1605
+ private setupOrthoCamera;
1606
+ private getDistance;
1607
+ private setPerspectiveCamera;
1608
+ }
1609
+ /**
1610
+ * The projection system of the camera.
1611
+ */
1612
+ export type CameraProjection = "Perspective" | "Orthographic";
1613
+ /**
1614
+ * The extensible list of supported navigation modes.
1615
+ */
1616
+ export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1617
+ /**
1618
+ * An object that determines the behavior of the camera controls
1619
+ * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1620
+ */
1621
+ export interface NavigationMode {
1622
+ /** The unique ID of this navigation mode. */
1623
+ id: NavModeID;
1624
+ /**
1625
+ * Enable or disable this navigation mode.
1626
+ * When a new navigation mode is enabled, the previous navigation mode
1627
+ * must be disabled.
1628
+ *
1629
+ * @param active - whether to enable or disable this mode.
1630
+ * @param options - any additional data required to enable or disable it.
1631
+ * */
1632
+ set: (active: boolean, options?: any) => void;
1633
+ /** Whether this navigation mode is active or not. */
1634
+ enabled: boolean;
1635
+ }
1636
+ import * as THREE from "three";
1637
+ import { Disposable, Event } from "../../Types";
1638
+ /**
1639
+ * A helper to easily get the real position of the mouse in the Three.js canvas
1640
+ * to work with tools like the
1641
+ * [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
1642
+ * been transformed through CSS or doesn't occupy the whole screen.
1643
+ */
1644
+ export declare class Mouse implements Disposable {
1645
+ dom: HTMLCanvasElement;
1646
+ private _event?;
1647
+ private _position;
1648
+ /** {@link Disposable.onDisposed} */
1649
+ readonly onDisposed: Event<unknown>;
1650
+ constructor(dom: HTMLCanvasElement);
1651
+ /**
1652
+ * The real position of the mouse of the Three.js canvas.
1653
+ */
1654
+ get position(): THREE.Vector2;
1655
+ /** {@link Disposable.dispose} */
1656
+ dispose(): void;
1657
+ private getPositionY;
1658
+ private getPositionX;
1659
+ private updateMouseInfo;
1660
+ private setupEvents;
1661
+ }
1662
+ import * as THREE from "three";
1475
1663
  import { Components } from "../../Components";
1664
+ import { Event, World, Disposable } from "../../Types";
1665
+ import { Mouse } from "./mouse";
1476
1666
  /**
1477
- * A basic camera that uses
1478
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
1479
- * easily control the camera in 2D and 3D. Check out it's API to find out
1480
- * what features it offers.
1667
+ * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
1668
+ * that allows to easily get items from the scene using the mouse and touch
1669
+ * events.
1481
1670
  */
1482
- export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
1483
- /** {@link Updateable.onBeforeUpdate} */
1484
- readonly onBeforeUpdate: Event<SimpleCamera>;
1485
- /** {@link Updateable.onAfterUpdate} */
1486
- readonly onAfterUpdate: Event<SimpleCamera>;
1487
- readonly onAspectUpdated: Event<unknown>;
1488
- /** {@link Disposable.onDisposed} */
1489
- readonly onDisposed: Event<string>;
1490
- three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1491
- private _allControls;
1492
- /**
1493
- * The object that controls the camera. An instance of
1494
- * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
1495
- * Transforming the camera directly will have no effect: you need to use this
1496
- * object to move, rotate, look at objects, etc.
1497
- */
1498
- get controls(): CameraControls;
1499
- /** {@link Component.enabled} */
1500
- get enabled(): boolean;
1671
+ export declare class SimpleRaycaster implements Disposable {
1501
1672
  /** {@link Component.enabled} */
1502
- set enabled(enabled: boolean);
1503
- constructor(components: Components);
1673
+ enabled: boolean;
1674
+ components: Components;
1675
+ /** {@link Disposable.onDisposed} */
1676
+ readonly onDisposed: Event<unknown>;
1677
+ /** The position of the mouse in the screen. */
1678
+ readonly mouse: Mouse;
1679
+ readonly three: THREE.Raycaster;
1680
+ world: World;
1681
+ constructor(components: Components, world: World);
1504
1682
  /** {@link Disposable.dispose} */
1505
1683
  dispose(): void;
1506
- /** {@link Updateable.update} */
1507
- update(_delta: number): void;
1508
1684
  /**
1509
- * Updates the aspect of the camera to match the size of the
1510
- * {@link Components.renderer}.
1685
+ * Throws a ray from the camera to the mouse or touch event point and returns
1686
+ * the first item found. This also takes into account the clipping planes
1687
+ * used by the renderer.
1688
+ *
1689
+ * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
1690
+ * to query. If not provided, it will query all the meshes stored in
1691
+ * {@link Components.meshes}.
1511
1692
  */
1512
- updateAspect: () => void;
1513
- private setupCamera;
1514
- private newCameraControls;
1515
- private setupEvents;
1516
- private static getSubsetOfThree;
1693
+ castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
1694
+ castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
1695
+ private intersect;
1696
+ private filterClippingPlanes;
1517
1697
  }
1518
1698
  import * as THREE from "three";
1519
1699
  import { Components } from "../../Components";
@@ -1582,249 +1762,142 @@ export declare class CullerRenderer {
1582
1762
  protected decreaseColor(): void;
1583
1763
  private applySettings;
1584
1764
  }
1585
- import * as THREE from "three";
1586
- import { BaseRenderer, Event } from "../../Types";
1587
- import { Components } from "../../Components";
1588
- /**
1589
- * A basic renderer capable of rendering
1590
- * ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
1591
- */
1592
- export declare class SimpleRenderer extends BaseRenderer {
1593
- enabled: boolean;
1594
- /** The HTML container of the THREE.js canvas where the scene is rendered. */
1595
- container: HTMLElement;
1596
- three: THREE.WebGLRenderer;
1597
- protected _canvas: HTMLCanvasElement;
1598
- protected _parameters?: Partial<THREE.WebGLRendererParameters>;
1599
- protected _resizeObserver: ResizeObserver | null;
1600
- protected onContainerUpdated: Event<unknown>;
1601
- private _resizing;
1602
- constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
1603
- /** {@link Updateable.update} */
1604
- update(): void;
1605
- /** {@link Disposable.dispose} */
1606
- dispose(): void;
1607
- /** {@link Resizeable.getSize}. */
1608
- getSize(): THREE.Vector2;
1609
- /** {@link Resizeable.resize} */
1610
- resize: (size?: THREE.Vector2) => void;
1611
- setupEvents(active: boolean): void;
1612
- private resizeEvent;
1613
- private setupRenderer;
1614
- private onContextLost;
1615
- private onContextBack;
1616
- }
1617
- import * as THREE from "three";
1618
- import { Hideable, Disposable, Event, World } from "../../Types";
1619
- import { Components } from "../../Components";
1620
- /**
1621
- * Each of the planes created by {@link SimpleClipper}.
1622
- */
1623
- export declare class SimplePlane implements Disposable, Hideable {
1624
- /** Event that fires when the user starts dragging a clipping plane. */
1625
- readonly onDraggingStarted: Event<unknown>;
1626
- /** Event that fires when the user stops dragging a clipping plane. */
1627
- readonly onDraggingEnded: Event<unknown>;
1628
- /** {@link Disposable.onDisposed} */
1629
- readonly onDisposed: Event<unknown>;
1630
- readonly normal: THREE.Vector3;
1631
- readonly origin: THREE.Vector3;
1632
- readonly three: THREE.Plane;
1633
- protected readonly _helper: THREE.Object3D;
1634
- protected _visible: boolean;
1635
- protected _enabled: boolean;
1636
- components: Components;
1637
- world: World;
1638
- private _controlsActive;
1639
- private readonly _arrowBoundBox;
1640
- private readonly _planeMesh;
1641
- private readonly _controls;
1642
- private readonly _hiddenMaterial;
1643
- get enabled(): boolean;
1644
- /** {@link Component.enabled} */
1645
- set enabled(state: boolean);
1646
- /** {@link Hideable.visible } */
1647
- get visible(): boolean;
1648
- /** {@link Hideable.visible } */
1649
- set visible(state: boolean);
1650
- /** The meshes used for raycasting */
1651
- get meshes(): THREE.Mesh[];
1652
- /** The material of the clipping plane representation. */
1653
- get planeMaterial(): THREE.Material | THREE.Material[];
1654
- /** The material of the clipping plane representation. */
1655
- set planeMaterial(material: THREE.Material | THREE.Material[]);
1656
- /** The size of the clipping plane representation. */
1657
- get size(): number;
1658
- /** Sets the size of the clipping plane representation. */
1659
- set size(size: number);
1660
- get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1661
- constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1662
- setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1663
- /** {@link Updateable.update} */
1664
- update: () => void;
1665
- /** {@link Disposable.dispose} */
1666
- dispose(): void;
1667
- private reset;
1668
- protected toggleControls(state: boolean): void;
1669
- private newTransformControls;
1670
- private initializeControls;
1671
- private createArrowBoundingBox;
1672
- private changeDrag;
1673
- private notifyDraggingChanged;
1674
- private preventCameraMovement;
1675
- private newHelper;
1676
- private static newPlaneMesh;
1677
- }
1765
+ export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1678
1766
  import * as THREE from "three";
1679
1767
  import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
1680
1768
  import { Components } from "../../Components";
1681
1769
  import { Event, World } from "../../Types";
1682
1770
  /**
1683
- * A renderer to determine a mesh visibility on screen
1684
- */
1685
- export declare class MeshCullerRenderer extends CullerRenderer {
1686
- threshold: number;
1687
- readonly onViewUpdated: Event<{
1688
- seen: Set<THREE.Mesh>;
1689
- unseen: Set<THREE.Mesh>;
1690
- }>;
1691
- colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1692
- isProcessing: boolean;
1693
- private _colorCodeMeshMap;
1694
- private _meshIDColorCodeMap;
1695
- private _currentVisibleMeshes;
1696
- private _recentlyHiddenMeshes;
1697
- private _intervalID;
1698
- private readonly _transparentMat;
1699
- constructor(components: Components, world: World, settings?: CullerRendererSettings);
1700
- dispose(): void;
1701
- add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1702
- remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1703
- private handleWorkerMessage;
1704
- private getAvailableMaterial;
1705
- }
1706
- export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
1707
- import * as THREE from "three";
1708
- import { BaseScene, Configurable, Event } from "../../Types";
1709
- import { Components } from "../../Components";
1710
- export interface SimpleSceneConfig {
1711
- directionalLight: {
1712
- color: THREE.Color;
1713
- intensity: number;
1714
- position: THREE.Vector3;
1715
- };
1716
- ambientLight: {
1717
- color: THREE.Color;
1718
- intensity: number;
1719
- };
1720
- }
1721
- /**
1722
- * A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
1723
- * objects hierarchically, and easily dispose them when you are finished with it.
1724
- * @noInheritDoc
1725
- */
1726
- export declare class SimpleScene extends BaseScene implements Configurable<{}> {
1727
- /** {@link Configurable.isSetup} */
1728
- isSetup: boolean;
1729
- three: THREE.Scene;
1730
- /** {@link Configurable.onSetup} */
1731
- readonly onSetup: Event<SimpleScene>;
1732
- config: Required<SimpleSceneConfig>;
1733
- constructor(components: Components);
1734
- /** Creates a simple and nice default set up for the scene (e.g. lighting). */
1735
- setup(config?: Partial<SimpleSceneConfig>): void;
1736
- }
1737
- import { NavigationMode } from "./types";
1738
- import { OrthoPerspectiveCamera } from "../index";
1739
- /**
1740
- * A {@link NavigationMode} that allows 3D navigation and panning
1741
- * like in many 3D and CAD softwares.
1742
- */
1743
- export declare class OrbitMode implements NavigationMode {
1744
- camera: OrthoPerspectiveCamera;
1745
- /** {@link NavigationMode.enabled} */
1746
- enabled: boolean;
1747
- /** {@link NavigationMode.id} */
1748
- readonly id = "Orbit";
1749
- constructor(camera: OrthoPerspectiveCamera);
1750
- /** {@link NavigationMode.set} */
1751
- set(active: boolean): void;
1752
- private activateOrbitControls;
1753
- }
1754
- import { NavigationMode } from "./types";
1755
- import { OrthoPerspectiveCamera } from "../index";
1756
- /**
1757
- * A {@link NavigationMode} that allows to navigate floorplans in 2D,
1758
- * like many BIM tools.
1759
- */
1760
- export declare class PlanMode implements NavigationMode {
1761
- private camera;
1762
- /** {@link NavigationMode.enabled} */
1763
- enabled: boolean;
1764
- /** {@link NavigationMode.id} */
1765
- readonly id = "Plan";
1766
- private mouseAction1?;
1767
- private mouseAction2?;
1768
- private mouseInitialized;
1769
- private readonly defaultAzimuthSpeed;
1770
- private readonly defaultPolarSpeed;
1771
- constructor(camera: OrthoPerspectiveCamera);
1772
- /** {@link NavigationMode.set} */
1773
- set(active: boolean): void;
1774
- }
1775
- import { NavigationMode } from "./types";
1776
- import { OrthoPerspectiveCamera } from "../index";
1777
- /**
1778
- * A {@link NavigationMode} that allows first person navigation,
1779
- * simulating FPS video games.
1771
+ * A renderer to determine a mesh visibility on screen
1780
1772
  */
1781
- export declare class FirstPersonMode implements NavigationMode {
1782
- private camera;
1783
- /** {@link NavigationMode.enabled} */
1784
- enabled: boolean;
1785
- /** {@link NavigationMode.id} */
1786
- readonly id = "FirstPerson";
1787
- constructor(camera: OrthoPerspectiveCamera);
1788
- /** {@link NavigationMode.set} */
1789
- set(active: boolean): void;
1790
- private setupFirstPersonCamera;
1773
+ export declare class MeshCullerRenderer extends CullerRenderer {
1774
+ threshold: number;
1775
+ readonly onViewUpdated: Event<{
1776
+ seen: Set<THREE.Mesh>;
1777
+ unseen: Set<THREE.Mesh>;
1778
+ }>;
1779
+ colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
1780
+ isProcessing: boolean;
1781
+ private _colorCodeMeshMap;
1782
+ private _meshIDColorCodeMap;
1783
+ private _currentVisibleMeshes;
1784
+ private _recentlyHiddenMeshes;
1785
+ private _intervalID;
1786
+ private readonly _transparentMat;
1787
+ constructor(components: Components, world: World, settings?: CullerRendererSettings);
1788
+ dispose(): void;
1789
+ add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1790
+ remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
1791
+ private handleWorkerMessage;
1792
+ private getAvailableMaterial;
1791
1793
  }
1792
1794
  import * as THREE from "three";
1793
- import { CameraProjection } from "./types";
1794
- import { Event } from "../../Types";
1795
- import { OrthoPerspectiveCamera } from "../index";
1795
+ import { Hideable, Disposable, Event, World } from "../../Types";
1796
+ import { Components } from "../../Components";
1796
1797
  /**
1797
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1798
+ * Each of the planes created by {@link SimpleClipper}.
1798
1799
  */
1799
- export declare class ProjectionManager {
1800
- /**
1801
- * Event that fires when the {@link CameraProjection} changes.
1802
- */
1803
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
1804
- current: CameraProjection;
1805
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
1806
- private _component;
1807
- private _previousDistance;
1808
- /** Match Ortho zoom with Perspective distance when changing projection mode */
1809
- matchOrthoDistanceEnabled: boolean;
1810
- constructor(camera: OrthoPerspectiveCamera);
1811
- /**
1812
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
1813
- *
1814
- * @param projection - the new projection to set. If it is the current projection,
1815
- * it will have no effect.
1816
- */
1817
- set(projection: CameraProjection): Promise<void>;
1800
+ export declare class SimplePlane implements Disposable, Hideable {
1801
+ /** Event that fires when the user starts dragging a clipping plane. */
1802
+ readonly onDraggingStarted: Event<unknown>;
1803
+ /** Event that fires when the user stops dragging a clipping plane. */
1804
+ readonly onDraggingEnded: Event<unknown>;
1805
+ /** {@link Disposable.onDisposed} */
1806
+ readonly onDisposed: Event<unknown>;
1807
+ readonly normal: THREE.Vector3;
1808
+ readonly origin: THREE.Vector3;
1809
+ readonly three: THREE.Plane;
1810
+ protected readonly _helper: THREE.Object3D;
1811
+ protected _visible: boolean;
1812
+ protected _enabled: boolean;
1813
+ components: Components;
1814
+ world: World;
1815
+ private _controlsActive;
1816
+ private readonly _arrowBoundBox;
1817
+ private readonly _planeMesh;
1818
+ private readonly _controls;
1819
+ private readonly _hiddenMaterial;
1820
+ get enabled(): boolean;
1821
+ /** {@link Component.enabled} */
1822
+ set enabled(state: boolean);
1823
+ /** {@link Hideable.visible } */
1824
+ get visible(): boolean;
1825
+ /** {@link Hideable.visible } */
1826
+ set visible(state: boolean);
1827
+ /** The meshes used for raycasting */
1828
+ get meshes(): THREE.Mesh[];
1829
+ /** The material of the clipping plane representation. */
1830
+ get planeMaterial(): THREE.Material | THREE.Material[];
1831
+ /** The material of the clipping plane representation. */
1832
+ set planeMaterial(material: THREE.Material | THREE.Material[]);
1833
+ /** The size of the clipping plane representation. */
1834
+ get size(): number;
1835
+ /** Sets the size of the clipping plane representation. */
1836
+ set size(size: number);
1837
+ get helper(): THREE.Object3D<THREE.Object3DEventMap>;
1838
+ constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
1839
+ setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
1840
+ /** {@link Updateable.update} */
1841
+ update: () => void;
1842
+ /** {@link Disposable.dispose} */
1843
+ dispose(): void;
1844
+ private reset;
1845
+ protected toggleControls(state: boolean): void;
1846
+ private newTransformControls;
1847
+ private initializeControls;
1848
+ private createArrowBoundingBox;
1849
+ private changeDrag;
1850
+ private notifyDraggingChanged;
1851
+ private preventCameraMovement;
1852
+ private newHelper;
1853
+ private static newPlaneMesh;
1854
+ }
1855
+ import * as WEBIFC from "web-ifc";
1856
+ /** Configuration of the IFC-fragment conversion. */
1857
+ export declare class IfcFragmentSettings {
1858
+ /** Whether to extract the IFC properties into a JSON. */
1859
+ includeProperties: boolean;
1818
1860
  /**
1819
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
1820
- * and vice versa.
1861
+ * Generate the geometry for categories that are not included by default,
1862
+ * like IFCSPACE.
1821
1863
  */
1822
- toggle(): Promise<void>;
1823
- private setOrthoCamera;
1824
- private getPerspectiveDims;
1825
- private setupOrthoCamera;
1826
- private getDistance;
1827
- private setPerspectiveCamera;
1864
+ optionalCategories: number[];
1865
+ /** Whether to use the coordination data coming from the IFC files. */
1866
+ coordinate: boolean;
1867
+ /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1868
+ wasm: {
1869
+ path: string;
1870
+ absolute: boolean;
1871
+ logLevel?: WEBIFC.LogLevel;
1872
+ };
1873
+ /** List of categories that won't be converted to fragments. */
1874
+ excludedCategories: Set<number>;
1875
+ /** Whether to save the absolute location of all IFC items. */
1876
+ saveLocations: boolean;
1877
+ /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1878
+ webIfc: WEBIFC.LoaderSettings;
1879
+ autoSetWasm: boolean;
1880
+ customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1881
+ }
1882
+ import * as THREE from "three";
1883
+ import * as WEBIFC from "web-ifc";
1884
+ import * as FRAGS from "@thatopen/fragments";
1885
+ export declare class CivilReader {
1886
+ defLineMat: THREE.LineBasicMaterial;
1887
+ read(webIfc: WEBIFC.IfcAPI): {
1888
+ alignments: Map<number, FRAGS.Alignment>;
1889
+ coordinationMatrix: THREE.Matrix4;
1890
+ } | undefined;
1891
+ get(civilItems: any): {
1892
+ alignments: Map<number, FRAGS.Alignment>;
1893
+ coordinationMatrix: THREE.Matrix4;
1894
+ } | undefined;
1895
+ private getCurves;
1896
+ }
1897
+ import * as WEBIFC from "web-ifc";
1898
+ export declare class IfcMetadataReader {
1899
+ getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1900
+ getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
1828
1901
  }
1829
1902
  import { IfcFragmentSettings } from "../../IfcLoader/src";
1830
1903
  /** Configuration of the IFC-fragment streaming. */
@@ -1836,33 +1909,6 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
1836
1909
  export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
1837
1910
  propertiesSize: number;
1838
1911
  }
1839
- /**
1840
- * The projection system of the camera.
1841
- */
1842
- export type CameraProjection = "Perspective" | "Orthographic";
1843
- /**
1844
- * The extensible list of supported navigation modes.
1845
- */
1846
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
1847
- /**
1848
- * An object that determines the behavior of the camera controls
1849
- * and the user input (e.g. 2D floor plan mode, first person mode, etc).
1850
- */
1851
- export interface NavigationMode {
1852
- /** The unique ID of this navigation mode. */
1853
- id: NavModeID;
1854
- /**
1855
- * Enable or disable this navigation mode.
1856
- * When a new navigation mode is enabled, the previous navigation mode
1857
- * must be disabled.
1858
- *
1859
- * @param active - whether to enable or disable this mode.
1860
- * @param options - any additional data required to enable or disable it.
1861
- * */
1862
- set: (active: boolean, options?: any) => void;
1863
- /** Whether this navigation mode is active or not. */
1864
- enabled: boolean;
1865
- }
1866
1912
  export interface StreamedGeometries {
1867
1913
  [id: number]: {
1868
1914
  boundingBox: Float32Array;
@@ -1879,6 +1925,16 @@ export interface StreamedAsset {
1879
1925
  }[];
1880
1926
  }
1881
1927
  import * as WEBIFC from "web-ifc";
1928
+ import * as THREE from "three";
1929
+ export declare class Units {
1930
+ factor: number;
1931
+ complement: number;
1932
+ apply(matrix: THREE.Matrix4): void;
1933
+ setUp(webIfc: WEBIFC.IfcAPI): void;
1934
+ private getLengthUnits;
1935
+ private getScaleMatrix;
1936
+ }
1937
+ import * as WEBIFC from "web-ifc";
1882
1938
  import { AsyncEvent, Component, Disposable, Event } from "../../../core";
1883
1939
  import { PropertiesStreamingSettings } from "./streaming-settings";
1884
1940
  export declare class FragmentPropsStreamConverter extends Component implements Disposable {
@@ -1905,47 +1961,6 @@ export declare class FragmentPropsStreamConverter extends Component implements D
1905
1961
  private getIndices;
1906
1962
  private cleanUp;
1907
1963
  }
1908
- import * as WEBIFC from "web-ifc";
1909
- /** Configuration of the IFC-fragment conversion. */
1910
- export declare class IfcFragmentSettings {
1911
- /** Whether to extract the IFC properties into a JSON. */
1912
- includeProperties: boolean;
1913
- /**
1914
- * Generate the geometry for categories that are not included by default,
1915
- * like IFCSPACE.
1916
- */
1917
- optionalCategories: number[];
1918
- /** Whether to use the coordination data coming from the IFC files. */
1919
- coordinate: boolean;
1920
- /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1921
- wasm: {
1922
- path: string;
1923
- absolute: boolean;
1924
- logLevel?: WEBIFC.LogLevel;
1925
- };
1926
- /** List of categories that won't be converted to fragments. */
1927
- excludedCategories: Set<number>;
1928
- /** Whether to save the absolute location of all IFC items. */
1929
- saveLocations: boolean;
1930
- /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
1931
- webIfc: WEBIFC.LoaderSettings;
1932
- autoSetWasm: boolean;
1933
- customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
1934
- }
1935
- import * as WEBIFC from "web-ifc";
1936
- import * as THREE from "three";
1937
- export declare class Units {
1938
- factor: number;
1939
- complement: number;
1940
- apply(matrix: THREE.Matrix4): void;
1941
- setUp(webIfc: WEBIFC.IfcAPI): void;
1942
- private getLengthUnits;
1943
- private getScaleMatrix;
1944
- }
1945
- import * as WEBIFC from "web-ifc";
1946
- export declare class IfcMetadataReader {
1947
- get(webIfc: WEBIFC.IfcAPI, type: number): string;
1948
- }
1949
1964
  export type RelationsMap = Map<number, Map<number, number[]>>;
1950
1965
  export interface ModelsRelationMap {
1951
1966
  [modelID: string]: RelationsMap;
@@ -1975,20 +1990,5 @@ import * as THREE from "three";
1975
1990
  export declare class TransformHelper {
1976
1991
  getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
1977
1992
  }
1978
- import * as THREE from "three";
1979
- import * as WEBIFC from "web-ifc";
1980
- import * as FRAGS from "@thatopen/fragments";
1981
- export declare class CivilReader {
1982
- defLineMat: THREE.LineBasicMaterial;
1983
- read(webIfc: WEBIFC.IfcAPI): {
1984
- alignments: Map<number, FRAGS.Alignment>;
1985
- coordinationMatrix: THREE.Matrix4;
1986
- } | undefined;
1987
- get(civilItems: any): {
1988
- alignments: Map<number, FRAGS.Alignment>;
1989
- coordinationMatrix: THREE.Matrix4;
1990
- } | undefined;
1991
- private getCurves;
1992
- }
1993
1993
 
1994
1994
  }