@thatopen/components 2.0.13 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Components/index.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +226 -163
- package/dist/namespace.d.ts +1439 -1355
- package/dist/utils/vertex-picker.d.ts +92 -8
- package/package.json +2 -2
package/dist/namespace.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Components implements Disposable {
|
|
|
7
7
|
/**
|
|
8
8
|
* The version of the @thatopen/components library.
|
|
9
9
|
*/
|
|
10
|
-
static readonly release = "2.0.
|
|
10
|
+
static readonly release = "2.0.14";
|
|
11
11
|
/** {@link Disposable.onDisposed} */
|
|
12
12
|
readonly onDisposed: Event<void>;
|
|
13
13
|
/**
|
|
@@ -120,47 +120,132 @@ export declare class Disposer extends Component {
|
|
|
120
120
|
private disposeChildren;
|
|
121
121
|
private static disposeMaterial;
|
|
122
122
|
}
|
|
123
|
-
import
|
|
124
|
-
import {
|
|
123
|
+
import * as THREE from "three";
|
|
124
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
125
|
+
import { SimplePlane } from "./src";
|
|
125
126
|
import { Components } from "../Components";
|
|
126
127
|
/**
|
|
127
|
-
* A component
|
|
128
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
129
|
+
*
|
|
130
|
+
* @param components - the instance of {@link Components} used.
|
|
131
|
+
* E.g. {@link SimplePlane}.
|
|
128
132
|
*/
|
|
129
|
-
export declare class
|
|
133
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
130
134
|
/**
|
|
131
135
|
* A unique identifier for the component.
|
|
132
136
|
* This UUID is used to register the component within the Components system.
|
|
133
137
|
*/
|
|
134
|
-
static readonly uuid: "
|
|
135
|
-
/**
|
|
136
|
-
|
|
138
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
139
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
140
|
+
readonly onBeforeDrag: Event<void>;
|
|
141
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
142
|
+
readonly onAfterDrag: Event<void>;
|
|
137
143
|
/**
|
|
138
|
-
*
|
|
139
|
-
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
144
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
140
145
|
*/
|
|
141
|
-
|
|
146
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
147
|
+
/**
|
|
148
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
149
|
+
*/
|
|
150
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
151
|
+
/**
|
|
152
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
153
|
+
*/
|
|
154
|
+
readonly onAfterCancel: Event<unknown>;
|
|
155
|
+
/**
|
|
156
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
157
|
+
*/
|
|
158
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* Event that fires after a clipping plane has been created.
|
|
161
|
+
* @param plane - The newly created clipping plane.
|
|
162
|
+
*/
|
|
163
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
164
|
+
/**
|
|
165
|
+
* Event that fires after a clipping plane has been deleted.
|
|
166
|
+
* @param plane - The deleted clipping plane.
|
|
167
|
+
*/
|
|
168
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
142
169
|
/** {@link Disposable.onDisposed} */
|
|
143
|
-
onDisposed: Event<
|
|
170
|
+
readonly onDisposed: Event<string>;
|
|
171
|
+
/**
|
|
172
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
173
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
174
|
+
* clipping plane is created in its roof, which might have a slight
|
|
175
|
+
* slope for draining purposes.
|
|
176
|
+
*/
|
|
177
|
+
orthogonalY: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
180
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
181
|
+
* has to be 'true' for this to apply.
|
|
182
|
+
*/
|
|
183
|
+
toleranceOrthogonalY: number;
|
|
184
|
+
/**
|
|
185
|
+
* The type of clipping plane to be created.
|
|
186
|
+
* Default is {@link SimplePlane}.
|
|
187
|
+
*/
|
|
188
|
+
Type: new (...args: any) => SimplePlane;
|
|
189
|
+
/**
|
|
190
|
+
* A list of all the clipping planes created by this component.
|
|
191
|
+
*/
|
|
192
|
+
list: SimplePlane[];
|
|
193
|
+
/** The material used in all the clipping planes. */
|
|
194
|
+
private _material;
|
|
195
|
+
private _size;
|
|
196
|
+
private _enabled;
|
|
197
|
+
private _visible;
|
|
198
|
+
/** {@link Component.enabled} */
|
|
199
|
+
get enabled(): boolean;
|
|
200
|
+
/** {@link Component.enabled} */
|
|
201
|
+
set enabled(state: boolean);
|
|
202
|
+
/** {@link Hideable.visible } */
|
|
203
|
+
get visible(): boolean;
|
|
204
|
+
/** {@link Hideable.visible } */
|
|
205
|
+
set visible(state: boolean);
|
|
206
|
+
/** The material of the clipping plane representation. */
|
|
207
|
+
get material(): THREE.MeshBasicMaterial;
|
|
208
|
+
/** The material of the clipping plane representation. */
|
|
209
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
210
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
211
|
+
get size(): number;
|
|
212
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
213
|
+
set size(size: number);
|
|
144
214
|
constructor(components: Components);
|
|
215
|
+
/** {@link Disposable.dispose} */
|
|
216
|
+
dispose(): void;
|
|
217
|
+
/** {@link Createable.create} */
|
|
218
|
+
create(world: World): void;
|
|
145
219
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
220
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
221
|
+
* without the need of the mouse.
|
|
149
222
|
*
|
|
150
|
-
* @param world -
|
|
151
|
-
* @
|
|
223
|
+
* @param world - the world where this plane should be created.
|
|
224
|
+
* @param normal - the orientation of the clipping plane.
|
|
225
|
+
* @param point - the position of the clipping plane.
|
|
226
|
+
* navigation.
|
|
152
227
|
*/
|
|
153
|
-
|
|
228
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
154
229
|
/**
|
|
155
|
-
*
|
|
156
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
230
|
+
* {@link Createable.delete}
|
|
157
231
|
*
|
|
158
|
-
* @param world -
|
|
159
|
-
* @
|
|
232
|
+
* @param world - the world where the plane to delete is.
|
|
233
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
234
|
+
* found under the cursor will be deleted.
|
|
160
235
|
*/
|
|
161
|
-
delete(world: World): void;
|
|
162
|
-
/**
|
|
163
|
-
|
|
236
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
237
|
+
/** Deletes all the existing clipping planes. */
|
|
238
|
+
deleteAll(): void;
|
|
239
|
+
private deletePlane;
|
|
240
|
+
private pickPlane;
|
|
241
|
+
private getAllPlaneMeshes;
|
|
242
|
+
private createPlaneFromIntersection;
|
|
243
|
+
private getWorldNormal;
|
|
244
|
+
private normalizePlaneDirectionY;
|
|
245
|
+
private newPlane;
|
|
246
|
+
private updateMaterialsAndPlanes;
|
|
247
|
+
private _onStartDragging;
|
|
248
|
+
private _onEndDragging;
|
|
164
249
|
}
|
|
165
250
|
import { Component, Disposable, World, Event } from "../Types";
|
|
166
251
|
import { GridConfig, SimpleGrid } from "./src";
|
|
@@ -211,6 +296,70 @@ export declare class Grids extends Component implements Disposable {
|
|
|
211
296
|
/** {@link Disposable.dispose} */
|
|
212
297
|
dispose(): void;
|
|
213
298
|
}
|
|
299
|
+
import * as THREE from "three";
|
|
300
|
+
import { Components } from "../Components";
|
|
301
|
+
import { SimpleCamera } from "..";
|
|
302
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
303
|
+
/**
|
|
304
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
305
|
+
*/
|
|
306
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
307
|
+
/**
|
|
308
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
309
|
+
*/
|
|
310
|
+
readonly projection: ProjectionManager;
|
|
311
|
+
/**
|
|
312
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
313
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
314
|
+
*/
|
|
315
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
316
|
+
/**
|
|
317
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
318
|
+
* This camera is used when the projection mode is set to perspective.
|
|
319
|
+
*/
|
|
320
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
321
|
+
protected readonly _userInputButtons: any;
|
|
322
|
+
protected readonly _frustumSize = 50;
|
|
323
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
324
|
+
protected _mode: NavigationMode | null;
|
|
325
|
+
private previousSize;
|
|
326
|
+
/**
|
|
327
|
+
* Getter for the current navigation mode.
|
|
328
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
329
|
+
*
|
|
330
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
331
|
+
*
|
|
332
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
333
|
+
*/
|
|
334
|
+
get mode(): NavigationMode;
|
|
335
|
+
constructor(components: Components);
|
|
336
|
+
/** {@link Disposable.dispose} */
|
|
337
|
+
dispose(): void;
|
|
338
|
+
/**
|
|
339
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
340
|
+
*
|
|
341
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
342
|
+
*/
|
|
343
|
+
set(mode: NavModeID): void;
|
|
344
|
+
/**
|
|
345
|
+
* Make the camera view fit all the specified meshes.
|
|
346
|
+
*
|
|
347
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
348
|
+
* evaluate {@link Components.meshes}.
|
|
349
|
+
* @param offset the distance to the fit object
|
|
350
|
+
*/
|
|
351
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
352
|
+
/**
|
|
353
|
+
* Allows or prevents all user input.
|
|
354
|
+
*
|
|
355
|
+
* @param active - whether to enable or disable user inputs.
|
|
356
|
+
*/
|
|
357
|
+
setUserInput(active: boolean): void;
|
|
358
|
+
private disableUserInput;
|
|
359
|
+
private enableUserInput;
|
|
360
|
+
private newOrthoCamera;
|
|
361
|
+
private setOrthoPerspCameraAspect;
|
|
362
|
+
}
|
|
214
363
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
215
364
|
import { Components } from "../Components";
|
|
216
365
|
import { SimpleWorld } from "./src";
|
|
@@ -278,6 +427,53 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
278
427
|
/** {@link Updateable.update} */
|
|
279
428
|
update(delta?: number): void | Promise<void>;
|
|
280
429
|
}
|
|
430
|
+
import { MiniMap } from "./src";
|
|
431
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
432
|
+
import { Components } from "../Components";
|
|
433
|
+
/**
|
|
434
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
435
|
+
*/
|
|
436
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
437
|
+
/**
|
|
438
|
+
* A unique identifier for the component.
|
|
439
|
+
* This UUID is used to register the component within the Components system.
|
|
440
|
+
*/
|
|
441
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
442
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
443
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
444
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
445
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
446
|
+
/** {@link Disposable.onDisposed} */
|
|
447
|
+
readonly onDisposed: Event<unknown>;
|
|
448
|
+
/** {@link Component.enabled} */
|
|
449
|
+
enabled: boolean;
|
|
450
|
+
/**
|
|
451
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
452
|
+
*/
|
|
453
|
+
list: Map<string, MiniMap>;
|
|
454
|
+
constructor(components: Components);
|
|
455
|
+
/**
|
|
456
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
457
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
458
|
+
*
|
|
459
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
460
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
461
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
462
|
+
*/
|
|
463
|
+
create(world: World): MiniMap;
|
|
464
|
+
/**
|
|
465
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
466
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
467
|
+
*
|
|
468
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
469
|
+
* @returns {void}
|
|
470
|
+
*/
|
|
471
|
+
delete(id: string): void;
|
|
472
|
+
/** {@link Disposable.dispose} */
|
|
473
|
+
dispose(): void;
|
|
474
|
+
/** {@link Updateable.update} */
|
|
475
|
+
update(): void;
|
|
476
|
+
}
|
|
281
477
|
import { Components } from "../Components";
|
|
282
478
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
283
479
|
import { Component, Event, Disposable, World } from "../Types";
|
|
@@ -326,243 +522,123 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
326
522
|
/** {@link Disposable.dispose} */
|
|
327
523
|
dispose(): void;
|
|
328
524
|
}
|
|
329
|
-
import
|
|
330
|
-
import {
|
|
331
|
-
import { SimplePlane } from "./src";
|
|
525
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
526
|
+
import { SimpleRaycaster } from "./src";
|
|
332
527
|
import { Components } from "../Components";
|
|
333
528
|
/**
|
|
334
|
-
* A
|
|
335
|
-
*
|
|
336
|
-
* @param components - the instance of {@link Components} used.
|
|
337
|
-
* E.g. {@link SimplePlane}.
|
|
529
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
338
530
|
*/
|
|
339
|
-
export declare class
|
|
531
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
340
532
|
/**
|
|
341
533
|
* A unique identifier for the component.
|
|
342
534
|
* This UUID is used to register the component within the Components system.
|
|
343
535
|
*/
|
|
344
|
-
static readonly uuid: "
|
|
345
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
346
|
-
readonly onBeforeDrag: Event<void>;
|
|
347
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
348
|
-
readonly onAfterDrag: Event<void>;
|
|
349
|
-
/**
|
|
350
|
-
* Event that fires when the user starts creating a clipping plane.
|
|
351
|
-
*/
|
|
352
|
-
readonly onBeforeCreate: Event<unknown>;
|
|
353
|
-
/**
|
|
354
|
-
* Event that fires when the user cancels the creation of a clipping plane.
|
|
355
|
-
*/
|
|
356
|
-
readonly onBeforeCancel: Event<unknown>;
|
|
357
|
-
/**
|
|
358
|
-
* Event that fires after the user cancels the creation of a clipping plane.
|
|
359
|
-
*/
|
|
360
|
-
readonly onAfterCancel: Event<unknown>;
|
|
361
|
-
/**
|
|
362
|
-
* Event that fires when the user starts deleting a clipping plane.
|
|
363
|
-
*/
|
|
364
|
-
readonly onBeforeDelete: Event<unknown>;
|
|
365
|
-
/**
|
|
366
|
-
* Event that fires after a clipping plane has been created.
|
|
367
|
-
* @param plane - The newly created clipping plane.
|
|
368
|
-
*/
|
|
369
|
-
readonly onAfterCreate: Event<SimplePlane>;
|
|
370
|
-
/**
|
|
371
|
-
* Event that fires after a clipping plane has been deleted.
|
|
372
|
-
* @param plane - The deleted clipping plane.
|
|
373
|
-
*/
|
|
374
|
-
readonly onAfterDelete: Event<SimplePlane>;
|
|
375
|
-
/** {@link Disposable.onDisposed} */
|
|
376
|
-
readonly onDisposed: Event<string>;
|
|
377
|
-
/**
|
|
378
|
-
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
379
|
-
* (up). This is desirable when clipping a building horizontally and a
|
|
380
|
-
* clipping plane is created in its roof, which might have a slight
|
|
381
|
-
* slope for draining purposes.
|
|
382
|
-
*/
|
|
383
|
-
orthogonalY: boolean;
|
|
384
|
-
/**
|
|
385
|
-
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
386
|
-
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
387
|
-
* has to be 'true' for this to apply.
|
|
388
|
-
*/
|
|
389
|
-
toleranceOrthogonalY: number;
|
|
390
|
-
/**
|
|
391
|
-
* The type of clipping plane to be created.
|
|
392
|
-
* Default is {@link SimplePlane}.
|
|
393
|
-
*/
|
|
394
|
-
Type: new (...args: any) => SimplePlane;
|
|
395
|
-
/**
|
|
396
|
-
* A list of all the clipping planes created by this component.
|
|
397
|
-
*/
|
|
398
|
-
list: SimplePlane[];
|
|
399
|
-
/** The material used in all the clipping planes. */
|
|
400
|
-
private _material;
|
|
401
|
-
private _size;
|
|
402
|
-
private _enabled;
|
|
403
|
-
private _visible;
|
|
404
|
-
/** {@link Component.enabled} */
|
|
405
|
-
get enabled(): boolean;
|
|
406
|
-
/** {@link Component.enabled} */
|
|
407
|
-
set enabled(state: boolean);
|
|
408
|
-
/** {@link Hideable.visible } */
|
|
409
|
-
get visible(): boolean;
|
|
410
|
-
/** {@link Hideable.visible } */
|
|
411
|
-
set visible(state: boolean);
|
|
412
|
-
/** The material of the clipping plane representation. */
|
|
413
|
-
get material(): THREE.MeshBasicMaterial;
|
|
414
|
-
/** The material of the clipping plane representation. */
|
|
415
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
416
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
417
|
-
get size(): number;
|
|
418
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
419
|
-
set size(size: number);
|
|
420
|
-
constructor(components: Components);
|
|
421
|
-
/** {@link Disposable.dispose} */
|
|
422
|
-
dispose(): void;
|
|
423
|
-
/** {@link Createable.create} */
|
|
424
|
-
create(world: World): void;
|
|
425
|
-
/**
|
|
426
|
-
* Creates a plane in a certain place and with a certain orientation,
|
|
427
|
-
* without the need of the mouse.
|
|
428
|
-
*
|
|
429
|
-
* @param world - the world where this plane should be created.
|
|
430
|
-
* @param normal - the orientation of the clipping plane.
|
|
431
|
-
* @param point - the position of the clipping plane.
|
|
432
|
-
* navigation.
|
|
433
|
-
*/
|
|
434
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
435
|
-
/**
|
|
436
|
-
* {@link Createable.delete}
|
|
437
|
-
*
|
|
438
|
-
* @param world - the world where the plane to delete is.
|
|
439
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
440
|
-
* found under the cursor will be deleted.
|
|
441
|
-
*/
|
|
442
|
-
delete(world: World, plane?: SimplePlane): void;
|
|
443
|
-
/** Deletes all the existing clipping planes. */
|
|
444
|
-
deleteAll(): void;
|
|
445
|
-
private deletePlane;
|
|
446
|
-
private pickPlane;
|
|
447
|
-
private getAllPlaneMeshes;
|
|
448
|
-
private createPlaneFromIntersection;
|
|
449
|
-
private getWorldNormal;
|
|
450
|
-
private normalizePlaneDirectionY;
|
|
451
|
-
private newPlane;
|
|
452
|
-
private updateMaterialsAndPlanes;
|
|
453
|
-
private _onStartDragging;
|
|
454
|
-
private _onEndDragging;
|
|
455
|
-
}
|
|
456
|
-
import { MiniMap } from "./src";
|
|
457
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
458
|
-
import { Components } from "../Components";
|
|
459
|
-
/**
|
|
460
|
-
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
461
|
-
*/
|
|
462
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
463
|
-
/**
|
|
464
|
-
* A unique identifier for the component.
|
|
465
|
-
* This UUID is used to register the component within the Components system.
|
|
466
|
-
*/
|
|
467
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
468
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
469
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
470
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
471
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
472
|
-
/** {@link Disposable.onDisposed} */
|
|
473
|
-
readonly onDisposed: Event<unknown>;
|
|
536
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
474
537
|
/** {@link Component.enabled} */
|
|
475
538
|
enabled: boolean;
|
|
476
539
|
/**
|
|
477
|
-
* A
|
|
540
|
+
* A Map that stores raycasters for each world.
|
|
541
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
478
542
|
*/
|
|
479
|
-
list: Map<string,
|
|
543
|
+
list: Map<string, SimpleRaycaster>;
|
|
544
|
+
/** {@link Disposable.onDisposed} */
|
|
545
|
+
onDisposed: Event<unknown>;
|
|
480
546
|
constructor(components: Components);
|
|
481
547
|
/**
|
|
482
|
-
*
|
|
483
|
-
* If a
|
|
548
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
549
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
550
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
484
551
|
*
|
|
485
|
-
* @param world - The
|
|
486
|
-
* @returns The
|
|
487
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
552
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
553
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
488
554
|
*/
|
|
489
|
-
|
|
555
|
+
get(world: World): SimpleRaycaster;
|
|
490
556
|
/**
|
|
491
|
-
* Deletes
|
|
492
|
-
* If a
|
|
557
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
558
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
493
559
|
*
|
|
494
|
-
* @param
|
|
560
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
495
561
|
* @returns {void}
|
|
496
562
|
*/
|
|
497
|
-
delete(
|
|
563
|
+
delete(world: World): void;
|
|
498
564
|
/** {@link Disposable.dispose} */
|
|
499
565
|
dispose(): void;
|
|
500
|
-
/** {@link Updateable.update} */
|
|
501
|
-
update(): void;
|
|
502
566
|
}
|
|
503
567
|
import * as THREE from "three";
|
|
504
|
-
import { Components } from "
|
|
505
|
-
import { SimpleCamera } from "..";
|
|
506
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
568
|
+
import { Component, Components } from "../../core";
|
|
507
569
|
/**
|
|
508
|
-
*
|
|
570
|
+
* Represents an edge measurement result.
|
|
509
571
|
*/
|
|
510
|
-
export
|
|
572
|
+
export interface MeasureEdge {
|
|
511
573
|
/**
|
|
512
|
-
*
|
|
574
|
+
* The distance between the two points of the edge.
|
|
513
575
|
*/
|
|
514
|
-
|
|
576
|
+
distance: number;
|
|
515
577
|
/**
|
|
516
|
-
*
|
|
517
|
-
* This camera is used when the projection mode is set to orthographic.
|
|
578
|
+
* The two points that define the edge.
|
|
518
579
|
*/
|
|
519
|
-
|
|
580
|
+
points: THREE.Vector3[];
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
584
|
+
*/
|
|
585
|
+
export declare class MeasurementUtils extends Component {
|
|
520
586
|
/**
|
|
521
|
-
* A
|
|
522
|
-
* This
|
|
587
|
+
* A unique identifier for the component.
|
|
588
|
+
* This UUID is used to register the component within the Components system.
|
|
523
589
|
*/
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
protected _mode: NavigationMode | null;
|
|
529
|
-
private previousSize;
|
|
590
|
+
static uuid: string;
|
|
591
|
+
/** {@link Component.enabled} */
|
|
592
|
+
enabled: boolean;
|
|
593
|
+
constructor(components: Components);
|
|
530
594
|
/**
|
|
531
|
-
*
|
|
532
|
-
* Throws an error if the mode is not found or the camera is not initialized.
|
|
533
|
-
*
|
|
534
|
-
* @returns {NavigationMode} The current navigation mode.
|
|
595
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
535
596
|
*
|
|
536
|
-
* @
|
|
597
|
+
* @param point - The point from which to calculate the distance.
|
|
598
|
+
* @param lineStart - The start point of the line segment.
|
|
599
|
+
* @param lineEnd - The end point of the line segment.
|
|
600
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
601
|
+
* @returns The distance from the point to the line segment.
|
|
537
602
|
*/
|
|
538
|
-
|
|
539
|
-
constructor(components: Components);
|
|
540
|
-
/** {@link Disposable.dispose} */
|
|
541
|
-
dispose(): void;
|
|
603
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
542
604
|
/**
|
|
543
|
-
*
|
|
605
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
606
|
+
* It also returns the edges of the found face and their indices.
|
|
544
607
|
*
|
|
545
|
-
* @param
|
|
608
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
609
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
610
|
+
* @param instance - The instance of the mesh (optional).
|
|
611
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
546
612
|
*/
|
|
547
|
-
|
|
613
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
614
|
+
edges: MeasureEdge[];
|
|
615
|
+
indices: Set<number>;
|
|
616
|
+
} | null;
|
|
548
617
|
/**
|
|
549
|
-
*
|
|
618
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
619
|
+
* It also applies instance transformation if provided.
|
|
550
620
|
*
|
|
551
|
-
* @param
|
|
552
|
-
*
|
|
553
|
-
* @param
|
|
621
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
622
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
623
|
+
* @param instance - The instance of the mesh (optional).
|
|
624
|
+
* @returns An object containing the vertices and normal of the face.
|
|
625
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
554
626
|
*/
|
|
555
|
-
|
|
627
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
628
|
+
p1: THREE.Vector3;
|
|
629
|
+
p2: THREE.Vector3;
|
|
630
|
+
p3: THREE.Vector3;
|
|
631
|
+
faceNormal: THREE.Vector3;
|
|
632
|
+
};
|
|
556
633
|
/**
|
|
557
|
-
*
|
|
634
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
635
|
+
* This is used to ensure numerical precision in edge detection.
|
|
558
636
|
*
|
|
559
|
-
* @param
|
|
637
|
+
* @param vector - The vector to round.
|
|
638
|
+
* @returns The vector with rounded components.
|
|
560
639
|
*/
|
|
561
|
-
|
|
562
|
-
private
|
|
563
|
-
private enableUserInput;
|
|
564
|
-
private newOrthoCamera;
|
|
565
|
-
private setOrthoPerspCameraAspect;
|
|
640
|
+
round(vector: THREE.Vector3): void;
|
|
641
|
+
private getFaceData;
|
|
566
642
|
}
|
|
567
643
|
import * as THREE from "three";
|
|
568
644
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -750,140 +826,6 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
750
826
|
private static getFragmentBounds;
|
|
751
827
|
}
|
|
752
828
|
import * as THREE from "three";
|
|
753
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
754
|
-
center: THREE.Vector3;
|
|
755
|
-
halfSizes: THREE.Vector3;
|
|
756
|
-
rotation: THREE.Matrix3;
|
|
757
|
-
transformation: THREE.Matrix4;
|
|
758
|
-
};
|
|
759
|
-
import * as THREE from "three";
|
|
760
|
-
export declare class MaterialsUtils {
|
|
761
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
762
|
-
}
|
|
763
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
764
|
-
export declare class UUID {
|
|
765
|
-
private static _pattern;
|
|
766
|
-
private static _lut;
|
|
767
|
-
static create(): string;
|
|
768
|
-
static validate(uuid: string): void;
|
|
769
|
-
}
|
|
770
|
-
import * as THREE from "three";
|
|
771
|
-
import { Component, Components, Event, World } from "../core";
|
|
772
|
-
export interface VertexPickerConfig {
|
|
773
|
-
showOnlyVertex: boolean;
|
|
774
|
-
snapDistance: number;
|
|
775
|
-
previewElement: HTMLElement;
|
|
776
|
-
}
|
|
777
|
-
export declare class VertexPicker extends Component {
|
|
778
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
779
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
780
|
-
components: Components;
|
|
781
|
-
private _pickedPoint;
|
|
782
|
-
private _config;
|
|
783
|
-
private _enabled;
|
|
784
|
-
private _workingPlane;
|
|
785
|
-
set enabled(value: boolean);
|
|
786
|
-
get enabled(): boolean;
|
|
787
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
788
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
789
|
-
get workingPlane(): THREE.Plane | null;
|
|
790
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
791
|
-
get config(): Partial<VertexPickerConfig>;
|
|
792
|
-
dispose(): void;
|
|
793
|
-
get(world: World): THREE.Vector3 | null;
|
|
794
|
-
private getClosestVertex;
|
|
795
|
-
private getVertices;
|
|
796
|
-
private getVertex;
|
|
797
|
-
}
|
|
798
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
799
|
-
import { Components, Component } from "../../core";
|
|
800
|
-
/**
|
|
801
|
-
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
802
|
-
*/
|
|
803
|
-
export declare class Hider extends Component {
|
|
804
|
-
/**
|
|
805
|
-
* A unique identifier for the component.
|
|
806
|
-
* This UUID is used to register the component within the Components system.
|
|
807
|
-
*/
|
|
808
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
809
|
-
/** {@link Component.enabled} */
|
|
810
|
-
enabled: boolean;
|
|
811
|
-
constructor(components: Components);
|
|
812
|
-
/**
|
|
813
|
-
* Sets the visibility of fragments within the 3D scene.
|
|
814
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
815
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
816
|
-
*
|
|
817
|
-
* @param visible - The visibility state to set for the fragments.
|
|
818
|
-
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
819
|
-
* If not provided, all fragments will be affected.
|
|
820
|
-
*
|
|
821
|
-
* @returns {void}
|
|
822
|
-
*/
|
|
823
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
824
|
-
/**
|
|
825
|
-
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
826
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
827
|
-
*
|
|
828
|
-
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
829
|
-
* If not provided, all fragments will be isolated.
|
|
830
|
-
*
|
|
831
|
-
* @returns {void}
|
|
832
|
-
*/
|
|
833
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
834
|
-
private updateCulledVisibility;
|
|
835
|
-
}
|
|
836
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
837
|
-
/**
|
|
838
|
-
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
839
|
-
*/
|
|
840
|
-
export declare class Exploder extends Component implements Disposable {
|
|
841
|
-
/**
|
|
842
|
-
* A unique identifier for the component.
|
|
843
|
-
* This UUID is used to register the component within the Components system.
|
|
844
|
-
*/
|
|
845
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
846
|
-
/** {@link Disposable.onDisposed} */
|
|
847
|
-
readonly onDisposed: Event<unknown>;
|
|
848
|
-
/** {@link Component.enabled} */
|
|
849
|
-
enabled: boolean;
|
|
850
|
-
/**
|
|
851
|
-
* The height of the explosion animation.
|
|
852
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
853
|
-
* Default value is 10.
|
|
854
|
-
*/
|
|
855
|
-
height: number;
|
|
856
|
-
/**
|
|
857
|
-
* The group name used for the explosion animation.
|
|
858
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
859
|
-
* Default value is "storeys".
|
|
860
|
-
*/
|
|
861
|
-
groupName: string;
|
|
862
|
-
/**
|
|
863
|
-
* A set of strings representing the exploded items.
|
|
864
|
-
* This set is used to keep track of which items have been exploded.
|
|
865
|
-
*/
|
|
866
|
-
list: Set<string>;
|
|
867
|
-
constructor(components: Components);
|
|
868
|
-
/** {@link Disposable.dispose} */
|
|
869
|
-
dispose(): void;
|
|
870
|
-
/**
|
|
871
|
-
* Sets the explosion state of the fragments.
|
|
872
|
-
*
|
|
873
|
-
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
874
|
-
*
|
|
875
|
-
* @remarks
|
|
876
|
-
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
877
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
878
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
879
|
-
*
|
|
880
|
-
* The method also keeps track of the exploded items using the 'list' set.
|
|
881
|
-
*
|
|
882
|
-
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
883
|
-
*/
|
|
884
|
-
set(active: boolean): void;
|
|
885
|
-
}
|
|
886
|
-
import * as THREE from "three";
|
|
887
829
|
import * as FRAGS from "@thatopen/fragments";
|
|
888
830
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
889
831
|
/**
|
|
@@ -1047,6 +989,121 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
1047
989
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1048
990
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
1049
991
|
}
|
|
992
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
993
|
+
/**
|
|
994
|
+
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
995
|
+
*/
|
|
996
|
+
export declare class Exploder extends Component implements Disposable {
|
|
997
|
+
/**
|
|
998
|
+
* A unique identifier for the component.
|
|
999
|
+
* This UUID is used to register the component within the Components system.
|
|
1000
|
+
*/
|
|
1001
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1002
|
+
/** {@link Disposable.onDisposed} */
|
|
1003
|
+
readonly onDisposed: Event<unknown>;
|
|
1004
|
+
/** {@link Component.enabled} */
|
|
1005
|
+
enabled: boolean;
|
|
1006
|
+
/**
|
|
1007
|
+
* The height of the explosion animation.
|
|
1008
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1009
|
+
* Default value is 10.
|
|
1010
|
+
*/
|
|
1011
|
+
height: number;
|
|
1012
|
+
/**
|
|
1013
|
+
* The group name used for the explosion animation.
|
|
1014
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1015
|
+
* Default value is "storeys".
|
|
1016
|
+
*/
|
|
1017
|
+
groupName: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* A set of strings representing the exploded items.
|
|
1020
|
+
* This set is used to keep track of which items have been exploded.
|
|
1021
|
+
*/
|
|
1022
|
+
list: Set<string>;
|
|
1023
|
+
constructor(components: Components);
|
|
1024
|
+
/** {@link Disposable.dispose} */
|
|
1025
|
+
dispose(): void;
|
|
1026
|
+
/**
|
|
1027
|
+
* Sets the explosion state of the fragments.
|
|
1028
|
+
*
|
|
1029
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1030
|
+
*
|
|
1031
|
+
* @remarks
|
|
1032
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1033
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1034
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1035
|
+
*
|
|
1036
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1037
|
+
*
|
|
1038
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1039
|
+
*/
|
|
1040
|
+
set(active: boolean): void;
|
|
1041
|
+
}
|
|
1042
|
+
import * as WEBIFC from "web-ifc";
|
|
1043
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1044
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1045
|
+
/**
|
|
1046
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1047
|
+
*/
|
|
1048
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1049
|
+
/**
|
|
1050
|
+
* A unique identifier for the component.
|
|
1051
|
+
* This UUID is used to register the component within the Components system.
|
|
1052
|
+
*/
|
|
1053
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1054
|
+
/**
|
|
1055
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1056
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1057
|
+
*/
|
|
1058
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1059
|
+
type: number;
|
|
1060
|
+
data: {
|
|
1061
|
+
[id: number]: any;
|
|
1062
|
+
};
|
|
1063
|
+
}>;
|
|
1064
|
+
/**
|
|
1065
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1066
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1067
|
+
*/
|
|
1068
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1069
|
+
/**
|
|
1070
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1071
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1072
|
+
*/
|
|
1073
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1074
|
+
/** {@link Disposable.onDisposed} */
|
|
1075
|
+
readonly onDisposed: Event<string>;
|
|
1076
|
+
/** {@link Component.enabled} */
|
|
1077
|
+
enabled: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1080
|
+
*/
|
|
1081
|
+
settings: PropertiesStreamingSettings;
|
|
1082
|
+
/**
|
|
1083
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1084
|
+
*/
|
|
1085
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1086
|
+
/** {@link Disposable.dispose} */
|
|
1087
|
+
dispose(): Promise<void>;
|
|
1088
|
+
/**
|
|
1089
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1090
|
+
*
|
|
1091
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1092
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1093
|
+
*/
|
|
1094
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1095
|
+
/**
|
|
1096
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1097
|
+
*
|
|
1098
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1099
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1100
|
+
*/
|
|
1101
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1102
|
+
private readIfcFile;
|
|
1103
|
+
private streamIfcFile;
|
|
1104
|
+
private streamAllProperties;
|
|
1105
|
+
private cleanUp;
|
|
1106
|
+
}
|
|
1050
1107
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1051
1108
|
import * as THREE from "three";
|
|
1052
1109
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -1274,269 +1331,307 @@ export declare class IfcLoader extends Component implements Disposable {
|
|
|
1274
1331
|
private getGeometry;
|
|
1275
1332
|
private autoSetWasm;
|
|
1276
1333
|
}
|
|
1277
|
-
import * as
|
|
1278
|
-
import { Components,
|
|
1279
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1334
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1335
|
+
import { Components, Component } from "../../core";
|
|
1280
1336
|
/**
|
|
1281
|
-
* A component that
|
|
1337
|
+
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1282
1338
|
*/
|
|
1283
|
-
export declare class
|
|
1339
|
+
export declare class Hider extends Component {
|
|
1284
1340
|
/**
|
|
1285
1341
|
* A unique identifier for the component.
|
|
1286
1342
|
* This UUID is used to register the component within the Components system.
|
|
1287
1343
|
*/
|
|
1288
|
-
static readonly uuid: "
|
|
1344
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1345
|
+
/** {@link Component.enabled} */
|
|
1346
|
+
enabled: boolean;
|
|
1347
|
+
constructor(components: Components);
|
|
1289
1348
|
/**
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1292
|
-
|
|
1293
|
-
readonly onGeometryStreamed: Event<{
|
|
1294
|
-
buffer: Uint8Array;
|
|
1295
|
-
data: StreamedGeometries;
|
|
1296
|
-
}>;
|
|
1297
|
-
/**
|
|
1298
|
-
* Event triggered when assets are streamed.
|
|
1299
|
-
* Contains the streamed assets.
|
|
1300
|
-
*/
|
|
1301
|
-
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1302
|
-
/**
|
|
1303
|
-
* Event triggered to indicate the progress of the streaming process.
|
|
1304
|
-
* Contains the progress percentage.
|
|
1305
|
-
*/
|
|
1306
|
-
readonly onProgress: Event<number>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Event triggered when the IFC file is loaded.
|
|
1309
|
-
* Contains the loaded IFC file data.
|
|
1310
|
-
*/
|
|
1311
|
-
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1312
|
-
/** {@link Disposable.onDisposed} */
|
|
1313
|
-
readonly onDisposed: Event<unknown>;
|
|
1314
|
-
/**
|
|
1315
|
-
* Settings for the IfcGeometryTiler.
|
|
1316
|
-
*/
|
|
1317
|
-
settings: IfcStreamingSettings;
|
|
1318
|
-
/** {@link Component.enabled} */
|
|
1319
|
-
enabled: boolean;
|
|
1320
|
-
/**
|
|
1321
|
-
* The WebIFC API instance used for IFC file processing.
|
|
1322
|
-
*/
|
|
1323
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1324
|
-
private _spatialTree;
|
|
1325
|
-
private _metaData;
|
|
1326
|
-
private _visitedGeometries;
|
|
1327
|
-
private _streamSerializer;
|
|
1328
|
-
private _geometries;
|
|
1329
|
-
private _geometryCount;
|
|
1330
|
-
private _civil;
|
|
1331
|
-
private _groupSerializer;
|
|
1332
|
-
private _assets;
|
|
1333
|
-
private _meshesWithHoles;
|
|
1334
|
-
constructor(components: Components);
|
|
1335
|
-
/** {@link Disposable.dispose} */
|
|
1336
|
-
dispose(): void;
|
|
1337
|
-
/**
|
|
1338
|
-
* This method streams the IFC file from a given buffer.
|
|
1339
|
-
*
|
|
1340
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1341
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1349
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1350
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1351
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1342
1352
|
*
|
|
1343
|
-
* @
|
|
1344
|
-
*
|
|
1353
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1354
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1355
|
+
* If not provided, all fragments will be affected.
|
|
1345
1356
|
*
|
|
1346
|
-
* @
|
|
1347
|
-
* '''typescript
|
|
1348
|
-
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1349
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
1350
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1351
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1352
|
-
* '''
|
|
1357
|
+
* @returns {void}
|
|
1353
1358
|
*/
|
|
1354
|
-
|
|
1359
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1355
1360
|
/**
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1359
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1361
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1362
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1360
1363
|
*
|
|
1361
|
-
* @
|
|
1362
|
-
*
|
|
1364
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1365
|
+
* If not provided, all fragments will be isolated.
|
|
1363
1366
|
*
|
|
1367
|
+
* @returns {void}
|
|
1364
1368
|
*/
|
|
1365
|
-
|
|
1366
|
-
private
|
|
1367
|
-
private streamIfcFile;
|
|
1368
|
-
private streamAllGeometries;
|
|
1369
|
-
private cleanUp;
|
|
1370
|
-
private getMesh;
|
|
1371
|
-
private getGeometry;
|
|
1372
|
-
private streamAssets;
|
|
1373
|
-
private streamGeometries;
|
|
1369
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1370
|
+
private updateCulledVisibility;
|
|
1374
1371
|
}
|
|
1372
|
+
import * as THREE from "three";
|
|
1373
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1374
|
+
center: THREE.Vector3;
|
|
1375
|
+
halfSizes: THREE.Vector3;
|
|
1376
|
+
rotation: THREE.Matrix3;
|
|
1377
|
+
transformation: THREE.Matrix4;
|
|
1378
|
+
};
|
|
1379
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1375
1380
|
import * as WEBIFC from "web-ifc";
|
|
1376
|
-
import {
|
|
1377
|
-
import {
|
|
1381
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1382
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1378
1383
|
/**
|
|
1379
|
-
*
|
|
1384
|
+
* Types for boolean properties in IFC schema.
|
|
1380
1385
|
*/
|
|
1381
|
-
export
|
|
1386
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1387
|
+
/**
|
|
1388
|
+
* Types for string properties in IFC schema.
|
|
1389
|
+
*/
|
|
1390
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1391
|
+
/**
|
|
1392
|
+
* Types for numeric properties in IFC schema.
|
|
1393
|
+
*/
|
|
1394
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1395
|
+
/**
|
|
1396
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1397
|
+
*/
|
|
1398
|
+
export interface ChangeMap {
|
|
1399
|
+
[modelID: string]: Set<number>;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1403
|
+
*/
|
|
1404
|
+
export interface AttributeListener {
|
|
1405
|
+
[modelID: string]: {
|
|
1406
|
+
[expressID: number]: {
|
|
1407
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1408
|
+
};
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1413
|
+
*/
|
|
1414
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1382
1415
|
/**
|
|
1383
1416
|
* A unique identifier for the component.
|
|
1384
1417
|
* This UUID is used to register the component within the Components system.
|
|
1385
1418
|
*/
|
|
1386
|
-
static readonly uuid: "
|
|
1419
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1420
|
+
/** {@link Disposable.onDisposed} */
|
|
1421
|
+
readonly onDisposed: Event<string>;
|
|
1387
1422
|
/**
|
|
1388
|
-
*
|
|
1389
|
-
* The event provides the type of the IFC entity and the corresponding data.
|
|
1423
|
+
* Event triggered when a file is requested for export.
|
|
1390
1424
|
*/
|
|
1391
|
-
readonly
|
|
1392
|
-
type: number;
|
|
1393
|
-
data: {
|
|
1394
|
-
[id: number]: any;
|
|
1395
|
-
};
|
|
1396
|
-
}>;
|
|
1425
|
+
readonly onRequestFile: Event<unknown>;
|
|
1397
1426
|
/**
|
|
1398
|
-
*
|
|
1399
|
-
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1427
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1400
1428
|
*/
|
|
1401
|
-
|
|
1429
|
+
ifcToExport: ArrayBuffer | null;
|
|
1402
1430
|
/**
|
|
1403
|
-
*
|
|
1404
|
-
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1431
|
+
* Event triggered when an element is added to a Pset.
|
|
1405
1432
|
*/
|
|
1406
|
-
readonly
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1433
|
+
readonly onElementToPset: Event<{
|
|
1434
|
+
model: FragmentsGroup;
|
|
1435
|
+
psetID: number;
|
|
1436
|
+
elementID: number;
|
|
1437
|
+
}>;
|
|
1411
1438
|
/**
|
|
1412
|
-
*
|
|
1439
|
+
* Event triggered when a property is added to a Pset.
|
|
1413
1440
|
*/
|
|
1414
|
-
|
|
1441
|
+
readonly onPropToPset: Event<{
|
|
1442
|
+
model: FragmentsGroup;
|
|
1443
|
+
psetID: number;
|
|
1444
|
+
propID: number;
|
|
1445
|
+
}>;
|
|
1415
1446
|
/**
|
|
1416
|
-
*
|
|
1447
|
+
* Event triggered when a Pset is removed.
|
|
1417
1448
|
*/
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1449
|
+
readonly onPsetRemoved: Event<{
|
|
1450
|
+
model: FragmentsGroup;
|
|
1451
|
+
psetID: number;
|
|
1452
|
+
}>;
|
|
1421
1453
|
/**
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
1424
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
1425
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1454
|
+
* Event triggered when data in the model changes.
|
|
1426
1455
|
*/
|
|
1427
|
-
|
|
1456
|
+
readonly onDataChanged: Event<{
|
|
1457
|
+
model: FragmentsGroup;
|
|
1458
|
+
expressID: number;
|
|
1459
|
+
}>;
|
|
1428
1460
|
/**
|
|
1429
|
-
*
|
|
1430
|
-
*
|
|
1431
|
-
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1432
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
1461
|
+
* Configuration for the WebAssembly module.
|
|
1433
1462
|
*/
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
import * as THREE from "three";
|
|
1441
|
-
import { Component, Components } from "../../core";
|
|
1442
|
-
/**
|
|
1443
|
-
* Represents an edge measurement result.
|
|
1444
|
-
*/
|
|
1445
|
-
export interface MeasureEdge {
|
|
1463
|
+
wasm: {
|
|
1464
|
+
path: string;
|
|
1465
|
+
absolute: boolean;
|
|
1466
|
+
};
|
|
1467
|
+
/** {@link Component.enabled} */
|
|
1468
|
+
enabled: boolean;
|
|
1446
1469
|
/**
|
|
1447
|
-
*
|
|
1470
|
+
* Map of attribute listeners.
|
|
1448
1471
|
*/
|
|
1449
|
-
|
|
1472
|
+
attributeListeners: AttributeListener;
|
|
1450
1473
|
/**
|
|
1451
|
-
* The
|
|
1474
|
+
* The currently selected model.
|
|
1452
1475
|
*/
|
|
1453
|
-
|
|
1454
|
-
}
|
|
1455
|
-
/**
|
|
1456
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
1457
|
-
*/
|
|
1458
|
-
export declare class MeasurementUtils extends Component {
|
|
1476
|
+
selectedModel?: FragmentsGroup;
|
|
1459
1477
|
/**
|
|
1460
|
-
*
|
|
1461
|
-
* This UUID is used to register the component within the Components system.
|
|
1478
|
+
* Map of changed entities in the model.
|
|
1462
1479
|
*/
|
|
1463
|
-
|
|
1464
|
-
/** {@link Component.enabled} */
|
|
1465
|
-
enabled: boolean;
|
|
1480
|
+
changeMap: ChangeMap;
|
|
1466
1481
|
constructor(components: Components);
|
|
1482
|
+
/** {@link Disposable.dispose} */
|
|
1483
|
+
dispose(): void;
|
|
1467
1484
|
/**
|
|
1468
|
-
*
|
|
1485
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1469
1486
|
*
|
|
1470
|
-
* @param
|
|
1471
|
-
* @
|
|
1472
|
-
* @
|
|
1473
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1474
|
-
* @returns The distance from the point to the line segment.
|
|
1487
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1488
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1489
|
+
* @returns The IFC schema associated with the given model.
|
|
1475
1490
|
*/
|
|
1476
|
-
static
|
|
1491
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1477
1492
|
/**
|
|
1478
|
-
* Method to
|
|
1479
|
-
* It also returns the edges of the found face and their indices.
|
|
1493
|
+
* Method to set properties data in the model.
|
|
1480
1494
|
*
|
|
1481
|
-
* @param
|
|
1482
|
-
* @param
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1495
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1496
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1497
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1498
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1499
|
+
*
|
|
1500
|
+
* @returns {Promise<void>} A promise that resolves when all the properties have been set.
|
|
1501
|
+
*
|
|
1502
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1485
1503
|
*/
|
|
1486
|
-
|
|
1487
|
-
edges: MeasureEdge[];
|
|
1488
|
-
indices: Set<number>;
|
|
1489
|
-
} | null;
|
|
1504
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1490
1505
|
/**
|
|
1491
|
-
*
|
|
1492
|
-
* It also applies instance transformation if provided.
|
|
1506
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
1493
1507
|
*
|
|
1494
|
-
* @param
|
|
1495
|
-
* @param
|
|
1496
|
-
* @param
|
|
1497
|
-
*
|
|
1498
|
-
* @
|
|
1508
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1509
|
+
* @param name - The name of the Pset.
|
|
1510
|
+
* @param description - (Optional) The description of the Pset.
|
|
1511
|
+
*
|
|
1512
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1513
|
+
*
|
|
1514
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1515
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1499
1516
|
*/
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
faceNormal: THREE.Vector3;
|
|
1505
|
-
};
|
|
1517
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
1518
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
1519
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1520
|
+
}>;
|
|
1506
1521
|
/**
|
|
1507
|
-
*
|
|
1508
|
-
* This is used to ensure numerical precision in edge detection.
|
|
1522
|
+
* Removes a Property Set (Pset) from the given model.
|
|
1509
1523
|
*
|
|
1510
|
-
* @param
|
|
1511
|
-
* @
|
|
1524
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1525
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
1526
|
+
*
|
|
1527
|
+
* @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
|
|
1528
|
+
*
|
|
1529
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1530
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1531
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1512
1532
|
*/
|
|
1513
|
-
|
|
1514
|
-
private getFaceData;
|
|
1515
|
-
}
|
|
1516
|
-
import * as WEBIFC from "web-ifc";
|
|
1517
|
-
import * as FRAG from "@thatopen/fragments";
|
|
1518
|
-
import { Component, Components } from "../../core";
|
|
1519
|
-
/**
|
|
1520
|
-
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1521
|
-
*/
|
|
1522
|
-
export declare class IfcJsonExporter extends Component {
|
|
1533
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1523
1534
|
/**
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1535
|
+
* Creates a new single-value property of type string in the given model.
|
|
1536
|
+
*
|
|
1537
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1538
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
1539
|
+
* @param name - The name of the property.
|
|
1540
|
+
* @param value - The value of the property. Must be a string.
|
|
1541
|
+
*
|
|
1542
|
+
* @returns The newly created single-value property.
|
|
1543
|
+
*
|
|
1544
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1545
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1526
1546
|
*/
|
|
1527
|
-
|
|
1528
|
-
/** {@link Component.enabled} */
|
|
1529
|
-
enabled: boolean;
|
|
1530
|
-
constructor(components: Components);
|
|
1547
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1531
1548
|
/**
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1534
|
-
* @param
|
|
1535
|
-
* @param
|
|
1536
|
-
* @param
|
|
1537
|
-
*
|
|
1549
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
1550
|
+
*
|
|
1551
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1552
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
1553
|
+
* @param name - The name of the property.
|
|
1554
|
+
* @param value - The value of the property. Must be a number.
|
|
1555
|
+
*
|
|
1556
|
+
* @returns The newly created single-value property.
|
|
1557
|
+
*
|
|
1558
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1559
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1538
1560
|
*/
|
|
1539
|
-
|
|
1561
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
1564
|
+
*
|
|
1565
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1566
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
1567
|
+
* @param name - The name of the property.
|
|
1568
|
+
* @param value - The value of the property. Must be a boolean.
|
|
1569
|
+
*
|
|
1570
|
+
* @returns The newly created single-value property.
|
|
1571
|
+
*
|
|
1572
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1573
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1574
|
+
*/
|
|
1575
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1576
|
+
/**
|
|
1577
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
1578
|
+
*
|
|
1579
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1580
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1581
|
+
* @param propID - The express ID of the property to be removed.
|
|
1582
|
+
*
|
|
1583
|
+
* @returns {Promise<void>} A promise that resolves when the property has been removed.
|
|
1584
|
+
*
|
|
1585
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1586
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1587
|
+
*/
|
|
1588
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1589
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
1592
|
+
*
|
|
1593
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1594
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1595
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
1596
|
+
*
|
|
1597
|
+
* @returns {Promise<void>} A promise that resolves when all the elements have been added.
|
|
1598
|
+
*
|
|
1599
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1600
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1601
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1602
|
+
*/
|
|
1603
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Saves the changes made to the model to a new IFC file.
|
|
1606
|
+
*
|
|
1607
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
1608
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1609
|
+
*
|
|
1610
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1611
|
+
*
|
|
1612
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
1613
|
+
*/
|
|
1614
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
1615
|
+
/**
|
|
1616
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
1617
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
1618
|
+
*
|
|
1619
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1620
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1621
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1622
|
+
*
|
|
1623
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
1624
|
+
*
|
|
1625
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
1626
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1627
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1628
|
+
*/
|
|
1629
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
1630
|
+
private increaseMaxID;
|
|
1631
|
+
private newGUID;
|
|
1632
|
+
private getOwnerHistory;
|
|
1633
|
+
private registerChange;
|
|
1634
|
+
private newSingleProperty;
|
|
1540
1635
|
}
|
|
1541
1636
|
import * as WEBIFC from "web-ifc";
|
|
1542
1637
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -1680,260 +1775,249 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1680
1775
|
dispose(): void;
|
|
1681
1776
|
}
|
|
1682
1777
|
import * as WEBIFC from "web-ifc";
|
|
1683
|
-
import
|
|
1684
|
-
import { Component,
|
|
1685
|
-
/**
|
|
1686
|
-
* Types for boolean properties in IFC schema.
|
|
1687
|
-
*/
|
|
1688
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1689
|
-
/**
|
|
1690
|
-
* Types for string properties in IFC schema.
|
|
1691
|
-
*/
|
|
1692
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1693
|
-
/**
|
|
1694
|
-
* Types for numeric properties in IFC schema.
|
|
1695
|
-
*/
|
|
1696
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1778
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1779
|
+
import { Component, Components } from "../../core";
|
|
1697
1780
|
/**
|
|
1698
|
-
*
|
|
1781
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1699
1782
|
*/
|
|
1700
|
-
export
|
|
1701
|
-
|
|
1783
|
+
export declare class IfcJsonExporter extends Component {
|
|
1784
|
+
/**
|
|
1785
|
+
* A unique identifier for the component.
|
|
1786
|
+
* This UUID is used to register the component within the Components system.
|
|
1787
|
+
*/
|
|
1788
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1789
|
+
/** {@link Component.enabled} */
|
|
1790
|
+
enabled: boolean;
|
|
1791
|
+
constructor(components: Components);
|
|
1792
|
+
/**
|
|
1793
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1794
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1795
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1796
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1797
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1798
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1799
|
+
*/
|
|
1800
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1702
1801
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
export interface AttributeListener {
|
|
1707
|
-
[modelID: string]: {
|
|
1708
|
-
[expressID: number]: {
|
|
1709
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1710
|
-
};
|
|
1711
|
-
};
|
|
1802
|
+
import * as THREE from "three";
|
|
1803
|
+
export declare class MaterialsUtils {
|
|
1804
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
1712
1805
|
}
|
|
1806
|
+
import * as WEBIFC from "web-ifc";
|
|
1807
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1808
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1713
1809
|
/**
|
|
1714
|
-
*
|
|
1810
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1715
1811
|
*/
|
|
1716
|
-
export declare class
|
|
1812
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1717
1813
|
/**
|
|
1718
1814
|
* A unique identifier for the component.
|
|
1719
1815
|
* This UUID is used to register the component within the Components system.
|
|
1720
1816
|
*/
|
|
1721
|
-
static readonly uuid: "
|
|
1722
|
-
/** {@link Disposable.onDisposed} */
|
|
1723
|
-
readonly onDisposed: Event<string>;
|
|
1817
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1724
1818
|
/**
|
|
1725
|
-
* Event triggered when
|
|
1819
|
+
* Event triggered when geometry is streamed.
|
|
1820
|
+
* Contains the streamed geometry data and its buffer.
|
|
1726
1821
|
*/
|
|
1727
|
-
readonly
|
|
1822
|
+
readonly onGeometryStreamed: Event<{
|
|
1823
|
+
buffer: Uint8Array;
|
|
1824
|
+
data: StreamedGeometries;
|
|
1825
|
+
}>;
|
|
1728
1826
|
/**
|
|
1729
|
-
*
|
|
1827
|
+
* Event triggered when assets are streamed.
|
|
1828
|
+
* Contains the streamed assets.
|
|
1730
1829
|
*/
|
|
1731
|
-
|
|
1830
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1732
1831
|
/**
|
|
1733
|
-
* Event triggered
|
|
1832
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1833
|
+
* Contains the progress percentage.
|
|
1734
1834
|
*/
|
|
1735
|
-
readonly
|
|
1736
|
-
model: FragmentsGroup;
|
|
1737
|
-
psetID: number;
|
|
1738
|
-
elementID: number;
|
|
1739
|
-
}>;
|
|
1740
|
-
/**
|
|
1741
|
-
* Event triggered when a property is added to a Pset.
|
|
1742
|
-
*/
|
|
1743
|
-
readonly onPropToPset: Event<{
|
|
1744
|
-
model: FragmentsGroup;
|
|
1745
|
-
psetID: number;
|
|
1746
|
-
propID: number;
|
|
1747
|
-
}>;
|
|
1748
|
-
/**
|
|
1749
|
-
* Event triggered when a Pset is removed.
|
|
1750
|
-
*/
|
|
1751
|
-
readonly onPsetRemoved: Event<{
|
|
1752
|
-
model: FragmentsGroup;
|
|
1753
|
-
psetID: number;
|
|
1754
|
-
}>;
|
|
1835
|
+
readonly onProgress: Event<number>;
|
|
1755
1836
|
/**
|
|
1756
|
-
* Event triggered when
|
|
1837
|
+
* Event triggered when the IFC file is loaded.
|
|
1838
|
+
* Contains the loaded IFC file data.
|
|
1757
1839
|
*/
|
|
1758
|
-
readonly
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
}>;
|
|
1840
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1841
|
+
/** {@link Disposable.onDisposed} */
|
|
1842
|
+
readonly onDisposed: Event<unknown>;
|
|
1762
1843
|
/**
|
|
1763
|
-
*
|
|
1844
|
+
* Settings for the IfcGeometryTiler.
|
|
1764
1845
|
*/
|
|
1765
|
-
|
|
1766
|
-
path: string;
|
|
1767
|
-
absolute: boolean;
|
|
1768
|
-
};
|
|
1846
|
+
settings: IfcStreamingSettings;
|
|
1769
1847
|
/** {@link Component.enabled} */
|
|
1770
1848
|
enabled: boolean;
|
|
1771
1849
|
/**
|
|
1772
|
-
*
|
|
1773
|
-
*/
|
|
1774
|
-
attributeListeners: AttributeListener;
|
|
1775
|
-
/**
|
|
1776
|
-
* The currently selected model.
|
|
1777
|
-
*/
|
|
1778
|
-
selectedModel?: FragmentsGroup;
|
|
1779
|
-
/**
|
|
1780
|
-
* Map of changed entities in the model.
|
|
1850
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1781
1851
|
*/
|
|
1782
|
-
|
|
1852
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1853
|
+
private _spatialTree;
|
|
1854
|
+
private _metaData;
|
|
1855
|
+
private _visitedGeometries;
|
|
1856
|
+
private _streamSerializer;
|
|
1857
|
+
private _geometries;
|
|
1858
|
+
private _geometryCount;
|
|
1859
|
+
private _civil;
|
|
1860
|
+
private _groupSerializer;
|
|
1861
|
+
private _assets;
|
|
1862
|
+
private _meshesWithHoles;
|
|
1783
1863
|
constructor(components: Components);
|
|
1784
1864
|
/** {@link Disposable.dispose} */
|
|
1785
1865
|
dispose(): void;
|
|
1786
1866
|
/**
|
|
1787
|
-
*
|
|
1788
|
-
*
|
|
1789
|
-
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1790
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1791
|
-
* @returns The IFC schema associated with the given model.
|
|
1792
|
-
*/
|
|
1793
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1794
|
-
/**
|
|
1795
|
-
* Method to set properties data in the model.
|
|
1867
|
+
* This method streams the IFC file from a given buffer.
|
|
1796
1868
|
*
|
|
1797
|
-
* @param
|
|
1798
|
-
* @
|
|
1799
|
-
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1800
|
-
* The rest of the properties will be set as the properties of the entity.
|
|
1869
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1870
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1801
1871
|
*
|
|
1802
|
-
* @
|
|
1872
|
+
* @remarks
|
|
1873
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1803
1874
|
*
|
|
1804
|
-
* @
|
|
1875
|
+
* @example
|
|
1876
|
+
* '''typescript
|
|
1877
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1878
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1879
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1880
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1881
|
+
* '''
|
|
1805
1882
|
*/
|
|
1806
|
-
|
|
1883
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1807
1884
|
/**
|
|
1808
|
-
*
|
|
1885
|
+
* This method streams the IFC file from a given callback.
|
|
1809
1886
|
*
|
|
1810
|
-
* @param
|
|
1811
|
-
* @
|
|
1812
|
-
* @param description - (Optional) The description of the Pset.
|
|
1887
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1888
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1813
1889
|
*
|
|
1814
|
-
* @
|
|
1890
|
+
* @remarks
|
|
1891
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1815
1892
|
*
|
|
1816
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1817
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1818
1893
|
*/
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1894
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1895
|
+
private readIfcFile;
|
|
1896
|
+
private streamIfcFile;
|
|
1897
|
+
private streamAllGeometries;
|
|
1898
|
+
private cleanUp;
|
|
1899
|
+
private getMesh;
|
|
1900
|
+
private getGeometry;
|
|
1901
|
+
private streamAssets;
|
|
1902
|
+
private streamGeometries;
|
|
1903
|
+
}
|
|
1904
|
+
export declare class UUID {
|
|
1905
|
+
private static _pattern;
|
|
1906
|
+
private static _lut;
|
|
1907
|
+
static create(): string;
|
|
1908
|
+
static validate(uuid: string): void;
|
|
1909
|
+
}
|
|
1910
|
+
import * as THREE from "three";
|
|
1911
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1912
|
+
/**
|
|
1913
|
+
* Configuration interface for the VertexPicker component.
|
|
1914
|
+
*/
|
|
1915
|
+
export interface VertexPickerConfig {
|
|
1823
1916
|
/**
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1827
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
1828
|
-
*
|
|
1829
|
-
* @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
|
|
1830
|
-
*
|
|
1831
|
-
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1832
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1833
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1917
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
1834
1918
|
*/
|
|
1835
|
-
|
|
1919
|
+
showOnlyVertex: boolean;
|
|
1836
1920
|
/**
|
|
1837
|
-
*
|
|
1838
|
-
*
|
|
1839
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1840
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
1841
|
-
* @param name - The name of the property.
|
|
1842
|
-
* @param value - The value of the property. Must be a string.
|
|
1843
|
-
*
|
|
1844
|
-
* @returns The newly created single-value property.
|
|
1845
|
-
*
|
|
1846
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1847
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1921
|
+
* The maximum distance for snapping to a vertex.
|
|
1848
1922
|
*/
|
|
1849
|
-
|
|
1923
|
+
snapDistance: number;
|
|
1850
1924
|
/**
|
|
1851
|
-
*
|
|
1852
|
-
*
|
|
1853
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1854
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
1855
|
-
* @param name - The name of the property.
|
|
1856
|
-
* @param value - The value of the property. Must be a number.
|
|
1857
|
-
*
|
|
1858
|
-
* @returns The newly created single-value property.
|
|
1859
|
-
*
|
|
1860
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1861
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1925
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1862
1926
|
*/
|
|
1863
|
-
|
|
1927
|
+
previewElement: HTMLElement;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1931
|
+
*/
|
|
1932
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
1933
|
+
/** {@link Disposable.onDisposed} */
|
|
1934
|
+
readonly onDisposed: Event<unknown>;
|
|
1864
1935
|
/**
|
|
1865
|
-
*
|
|
1866
|
-
*
|
|
1867
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1868
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
1869
|
-
* @param name - The name of the property.
|
|
1870
|
-
* @param value - The value of the property. Must be a boolean.
|
|
1871
|
-
*
|
|
1872
|
-
* @returns The newly created single-value property.
|
|
1873
|
-
*
|
|
1874
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1875
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1936
|
+
* An event that is triggered when a vertex is found.
|
|
1937
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1876
1938
|
*/
|
|
1877
|
-
|
|
1939
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1878
1940
|
/**
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
*
|
|
1885
|
-
|
|
1941
|
+
* An event that is triggered when a vertex is lost.
|
|
1942
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1943
|
+
*/
|
|
1944
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1945
|
+
/**
|
|
1946
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
1947
|
+
*/
|
|
1948
|
+
components: Components;
|
|
1949
|
+
/**
|
|
1950
|
+
* A reference to the working plane used for vertex picking.
|
|
1951
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
1952
|
+
* If this value is null, all vertices are considered valid.
|
|
1953
|
+
*/
|
|
1954
|
+
workingPlane: THREE.Plane | null;
|
|
1955
|
+
private _pickedPoint;
|
|
1956
|
+
private _config;
|
|
1957
|
+
private _enabled;
|
|
1958
|
+
/**
|
|
1959
|
+
* Sets the enabled state of the VertexPicker.
|
|
1960
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1961
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1886
1962
|
*
|
|
1887
|
-
* @
|
|
1888
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1963
|
+
* @param value - The new enabled state.
|
|
1889
1964
|
*/
|
|
1890
|
-
|
|
1891
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
1965
|
+
set enabled(value: boolean);
|
|
1892
1966
|
/**
|
|
1893
|
-
*
|
|
1967
|
+
* Gets the current enabled state of the VertexPicker.
|
|
1894
1968
|
*
|
|
1895
|
-
* @
|
|
1896
|
-
|
|
1897
|
-
|
|
1969
|
+
* @returns The current enabled state.
|
|
1970
|
+
*/
|
|
1971
|
+
get enabled(): boolean;
|
|
1972
|
+
/**
|
|
1973
|
+
* Sets the configuration for the VertexPicker component.
|
|
1898
1974
|
*
|
|
1899
|
-
* @
|
|
1975
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
1976
|
+
* The properties not provided in the value object will retain their current values.
|
|
1900
1977
|
*
|
|
1901
|
-
* @
|
|
1902
|
-
*
|
|
1903
|
-
*
|
|
1978
|
+
* @example
|
|
1979
|
+
* '''typescript
|
|
1980
|
+
* vertexPicker.config = {
|
|
1981
|
+
* snapDistance: 0.5,
|
|
1982
|
+
* showOnlyVertex: true,
|
|
1983
|
+
* };
|
|
1984
|
+
* '''
|
|
1904
1985
|
*/
|
|
1905
|
-
|
|
1986
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
1906
1987
|
/**
|
|
1907
|
-
*
|
|
1988
|
+
* Gets the current configuration for the VertexPicker component.
|
|
1908
1989
|
*
|
|
1909
|
-
* @
|
|
1910
|
-
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1911
|
-
*
|
|
1912
|
-
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1990
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
1913
1991
|
*
|
|
1914
|
-
* @
|
|
1992
|
+
* @example
|
|
1993
|
+
* '''typescript
|
|
1994
|
+
* const currentConfig = vertexPicker.config;
|
|
1995
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1996
|
+
* '''
|
|
1915
1997
|
*/
|
|
1916
|
-
|
|
1998
|
+
get config(): Partial<VertexPickerConfig>;
|
|
1999
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
2000
|
+
/** {@link Disposable.dispose} */
|
|
2001
|
+
dispose(): void;
|
|
1917
2002
|
/**
|
|
1918
|
-
*
|
|
1919
|
-
* The listener will trigger an event whenever the attribute's value changes.
|
|
2003
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1920
2004
|
*
|
|
1921
|
-
* @param
|
|
1922
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1923
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
2005
|
+
* @param world - The World instance to use for raycasting.
|
|
1924
2006
|
*
|
|
1925
|
-
* @returns The
|
|
2007
|
+
* @returns The current picked point, or null if no point is picked.
|
|
1926
2008
|
*
|
|
1927
|
-
* @
|
|
1928
|
-
*
|
|
1929
|
-
*
|
|
2009
|
+
* @remarks
|
|
2010
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
2011
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2012
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2013
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2014
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2015
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1930
2016
|
*/
|
|
1931
|
-
|
|
1932
|
-
private
|
|
1933
|
-
private
|
|
1934
|
-
private
|
|
1935
|
-
private registerChange;
|
|
1936
|
-
private newSingleProperty;
|
|
2017
|
+
get(world: World): THREE.Vector3 | null;
|
|
2018
|
+
private getClosestVertex;
|
|
2019
|
+
private getVertices;
|
|
2020
|
+
private getVertex;
|
|
1937
2021
|
}
|
|
1938
2022
|
import * as WEBIFC from "web-ifc";
|
|
1939
2023
|
import { IfcItemsCategories } from "../../../ifc";
|
|
@@ -2032,6 +2116,10 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2032
2116
|
resize(size?: THREE.Vector2): void;
|
|
2033
2117
|
private updatePlanes;
|
|
2034
2118
|
}
|
|
2119
|
+
/**
|
|
2120
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2121
|
+
*/
|
|
2122
|
+
export declare const GeometryTypes: Set<number>;
|
|
2035
2123
|
import * as WEBIFC from "web-ifc";
|
|
2036
2124
|
/** Configuration of the IFC-fragment conversion. */
|
|
2037
2125
|
export declare class IfcFragmentSettings {
|
|
@@ -2073,10 +2161,6 @@ export declare class IfcFragmentSettings {
|
|
|
2073
2161
|
*/
|
|
2074
2162
|
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2075
2163
|
}
|
|
2076
|
-
/**
|
|
2077
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
2078
|
-
*/
|
|
2079
|
-
export declare const GeometryTypes: Set<number>;
|
|
2080
2164
|
import * as WEBIFC from "web-ifc";
|
|
2081
2165
|
export interface IfcItemsCategories {
|
|
2082
2166
|
[itemID: number]: number;
|
|
@@ -2095,12 +2179,6 @@ export declare class IfcCategories {
|
|
|
2095
2179
|
export declare const IfcElements: {
|
|
2096
2180
|
[key: number]: string;
|
|
2097
2181
|
};
|
|
2098
|
-
/**
|
|
2099
|
-
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2100
|
-
*/
|
|
2101
|
-
export declare const IfcCategoryMap: {
|
|
2102
|
-
[key: number]: string;
|
|
2103
|
-
};
|
|
2104
2182
|
import * as FRAGS from "@thatopen/fragments";
|
|
2105
2183
|
export declare class IfcPropertiesUtils {
|
|
2106
2184
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2127,33 +2205,11 @@ export declare class IfcPropertiesUtils {
|
|
|
2127
2205
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2128
2206
|
}
|
|
2129
2207
|
/**
|
|
2130
|
-
*
|
|
2208
|
+
* A map that associates each unique integer identifier (IFC Entity ID) with its corresponding category name. This map is used to map IFC entities to their respective categories for easier identification and processing.
|
|
2131
2209
|
*/
|
|
2132
|
-
export declare
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
* @param handler - the callback to be added to this event.
|
|
2136
|
-
*/
|
|
2137
|
-
add(handler: T extends void ? {
|
|
2138
|
-
(): void;
|
|
2139
|
-
} : {
|
|
2140
|
-
(data: T): void;
|
|
2141
|
-
}): void;
|
|
2142
|
-
/**
|
|
2143
|
-
* Removes a callback from this event instance.
|
|
2144
|
-
* @param handler - the callback to be removed from this event.
|
|
2145
|
-
*/
|
|
2146
|
-
remove(handler: T extends void ? {
|
|
2147
|
-
(): void;
|
|
2148
|
-
} : {
|
|
2149
|
-
(data: T): void;
|
|
2150
|
-
}): void;
|
|
2151
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2152
|
-
trigger: (data?: T) => void;
|
|
2153
|
-
/** Gets rid of all the suscribed events. */
|
|
2154
|
-
reset(): void;
|
|
2155
|
-
private handlers;
|
|
2156
|
-
}
|
|
2210
|
+
export declare const IfcCategoryMap: {
|
|
2211
|
+
[key: number]: string;
|
|
2212
|
+
};
|
|
2157
2213
|
import * as THREE from "three";
|
|
2158
2214
|
import CameraControls from "camera-controls";
|
|
2159
2215
|
import { Event } from "./event";
|
|
@@ -2262,6 +2318,34 @@ export interface CameraControllable {
|
|
|
2262
2318
|
*/
|
|
2263
2319
|
controls: CameraControls;
|
|
2264
2320
|
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2323
|
+
*/
|
|
2324
|
+
export declare class Event<T> {
|
|
2325
|
+
/**
|
|
2326
|
+
* Add a callback to this event instance.
|
|
2327
|
+
* @param handler - the callback to be added to this event.
|
|
2328
|
+
*/
|
|
2329
|
+
add(handler: T extends void ? {
|
|
2330
|
+
(): void;
|
|
2331
|
+
} : {
|
|
2332
|
+
(data: T): void;
|
|
2333
|
+
}): void;
|
|
2334
|
+
/**
|
|
2335
|
+
* Removes a callback from this event instance.
|
|
2336
|
+
* @param handler - the callback to be removed from this event.
|
|
2337
|
+
*/
|
|
2338
|
+
remove(handler: T extends void ? {
|
|
2339
|
+
(): void;
|
|
2340
|
+
} : {
|
|
2341
|
+
(data: T): void;
|
|
2342
|
+
}): void;
|
|
2343
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2344
|
+
trigger: (data?: T) => void;
|
|
2345
|
+
/** Gets rid of all the suscribed events. */
|
|
2346
|
+
reset(): void;
|
|
2347
|
+
private handlers;
|
|
2348
|
+
}
|
|
2265
2349
|
import { Base } from "./base";
|
|
2266
2350
|
/**
|
|
2267
2351
|
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
@@ -2294,6 +2378,29 @@ export declare abstract class Base {
|
|
|
2294
2378
|
/** Whether is component is {@link Configurable}. */
|
|
2295
2379
|
isConfigurable: () => this is Configurable<any>;
|
|
2296
2380
|
}
|
|
2381
|
+
import { Base } from "./base";
|
|
2382
|
+
import { World } from "./world";
|
|
2383
|
+
import { Event } from "./event";
|
|
2384
|
+
import { Components } from "../../Components";
|
|
2385
|
+
/**
|
|
2386
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2387
|
+
*/
|
|
2388
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
2389
|
+
readonly worlds: Map<string, World>;
|
|
2390
|
+
/**
|
|
2391
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2392
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2393
|
+
*/
|
|
2394
|
+
readonly onWorldChanged: Event<{
|
|
2395
|
+
world: World;
|
|
2396
|
+
action: "added" | "removed";
|
|
2397
|
+
}>;
|
|
2398
|
+
/**
|
|
2399
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2400
|
+
*/
|
|
2401
|
+
currentWorld: World | null;
|
|
2402
|
+
protected constructor(components: Components);
|
|
2403
|
+
}
|
|
2297
2404
|
/**
|
|
2298
2405
|
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2299
2406
|
*/
|
|
@@ -2322,6 +2429,11 @@ export declare class AsyncEvent<T> {
|
|
|
2322
2429
|
reset(): void;
|
|
2323
2430
|
private handlers;
|
|
2324
2431
|
}
|
|
2432
|
+
import { InverseAttribute } from "./types";
|
|
2433
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2434
|
+
forRelating: InverseAttribute;
|
|
2435
|
+
forRelated: InverseAttribute;
|
|
2436
|
+
}>;
|
|
2325
2437
|
import * as THREE from "three";
|
|
2326
2438
|
import CameraControls from "camera-controls";
|
|
2327
2439
|
import { BaseWorldItem } from "./base-world-item";
|
|
@@ -2350,54 +2462,6 @@ export declare abstract class BaseCamera extends BaseWorldItem {
|
|
|
2350
2462
|
*/
|
|
2351
2463
|
hasCameraControls: () => this is CameraControllable;
|
|
2352
2464
|
}
|
|
2353
|
-
import { Base } from "./base";
|
|
2354
|
-
import { World } from "./world";
|
|
2355
|
-
import { Event } from "./event";
|
|
2356
|
-
import { Components } from "../../Components";
|
|
2357
|
-
/**
|
|
2358
|
-
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2359
|
-
*/
|
|
2360
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
2361
|
-
readonly worlds: Map<string, World>;
|
|
2362
|
-
/**
|
|
2363
|
-
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2364
|
-
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2365
|
-
*/
|
|
2366
|
-
readonly onWorldChanged: Event<{
|
|
2367
|
-
world: World;
|
|
2368
|
-
action: "added" | "removed";
|
|
2369
|
-
}>;
|
|
2370
|
-
/**
|
|
2371
|
-
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2372
|
-
*/
|
|
2373
|
-
currentWorld: World | null;
|
|
2374
|
-
protected constructor(components: Components);
|
|
2375
|
-
}
|
|
2376
|
-
import { InverseAttribute } from "./types";
|
|
2377
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2378
|
-
forRelating: InverseAttribute;
|
|
2379
|
-
forRelated: InverseAttribute;
|
|
2380
|
-
}>;
|
|
2381
|
-
import * as THREE from "three";
|
|
2382
|
-
import { Disposable } from "./interfaces";
|
|
2383
|
-
import { Event } from "./event";
|
|
2384
|
-
import { Components } from "../../Components";
|
|
2385
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2386
|
-
/**
|
|
2387
|
-
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2388
|
-
*/
|
|
2389
|
-
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2390
|
-
/** {@link Disposable.onDisposed} */
|
|
2391
|
-
readonly onDisposed: Event<unknown>;
|
|
2392
|
-
/**
|
|
2393
|
-
* Abstract property representing the three.js object associated with this scene.
|
|
2394
|
-
* It should be implemented by subclasses.
|
|
2395
|
-
*/
|
|
2396
|
-
abstract three: THREE.Object3D;
|
|
2397
|
-
protected constructor(components: Components);
|
|
2398
|
-
/** {@link Disposable.dispose} */
|
|
2399
|
-
dispose(): void;
|
|
2400
|
-
}
|
|
2401
2465
|
import * as THREE from "three";
|
|
2402
2466
|
import { Vector2 } from "three";
|
|
2403
2467
|
import { Event } from "./event";
|
|
@@ -2431,402 +2495,92 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2431
2495
|
abstract update(delta?: number): void | Promise<void>;
|
|
2432
2496
|
/** {@link Disposable.dispose} */
|
|
2433
2497
|
abstract dispose(): void;
|
|
2434
|
-
/** {@link Resizeable.getSize} */
|
|
2435
|
-
abstract getSize(): Vector2;
|
|
2436
|
-
/** {@link Resizeable.resize} */
|
|
2437
|
-
abstract resize(size: Vector2 | undefined): void;
|
|
2438
|
-
/**
|
|
2439
|
-
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
2440
|
-
*/
|
|
2441
|
-
clippingPlanes: THREE.Plane[];
|
|
2442
|
-
/**
|
|
2443
|
-
* Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
|
|
2444
|
-
*
|
|
2445
|
-
* @remarks
|
|
2446
|
-
* This method is typically called when there is a change to the list of clipping planes
|
|
2447
|
-
* used by the active renderer.
|
|
2448
|
-
*/
|
|
2449
|
-
updateClippingPlanes(): void;
|
|
2450
|
-
/**
|
|
2451
|
-
* Sets or removes a clipping plane from the renderer.
|
|
2452
|
-
*
|
|
2453
|
-
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
2454
|
-
* @param plane - The clipping plane to be added or removed.
|
|
2455
|
-
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
|
|
2456
|
-
*
|
|
2457
|
-
* @remarks
|
|
2458
|
-
* This method adds or removes a clipping plane from the 'clippingPlanes' array.
|
|
2459
|
-
* If 'active' is 'true' and the plane is not already in the array, it is added.
|
|
2460
|
-
* If 'active' is 'false' and the plane is in the array, it is removed.
|
|
2461
|
-
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
2462
|
-
* excluding any planes marked as local.
|
|
2463
|
-
*/
|
|
2464
|
-
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2465
|
-
}
|
|
2466
|
-
import * as THREE from "three";
|
|
2467
|
-
import { BaseScene } from "./base-scene";
|
|
2468
|
-
import { BaseCamera } from "./base-camera";
|
|
2469
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2470
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
2471
|
-
/**
|
|
2472
|
-
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2473
|
-
*/
|
|
2474
|
-
export interface World extends Disposable, Updateable {
|
|
2475
|
-
/**
|
|
2476
|
-
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2477
|
-
*/
|
|
2478
|
-
meshes: Set<THREE.Mesh>;
|
|
2479
|
-
/**
|
|
2480
|
-
* The base scene of the world.
|
|
2481
|
-
*/
|
|
2482
|
-
scene: BaseScene;
|
|
2483
|
-
/**
|
|
2484
|
-
* The base camera of the world.
|
|
2485
|
-
*/
|
|
2486
|
-
camera: BaseCamera;
|
|
2487
|
-
/**
|
|
2488
|
-
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2489
|
-
*/
|
|
2490
|
-
renderer: BaseRenderer | null;
|
|
2491
|
-
/**
|
|
2492
|
-
* A unique identifier for the world.
|
|
2493
|
-
*/
|
|
2494
|
-
uuid: string;
|
|
2495
|
-
/**
|
|
2496
|
-
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2497
|
-
*/
|
|
2498
|
-
isDisposing: boolean;
|
|
2499
|
-
}
|
|
2500
|
-
import { NavigationMode } from "./types";
|
|
2501
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2502
|
-
/**
|
|
2503
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2504
|
-
*/
|
|
2505
|
-
export declare class OrbitMode implements NavigationMode {
|
|
2506
|
-
camera: OrthoPerspectiveCamera;
|
|
2507
|
-
/** {@link NavigationMode.enabled} */
|
|
2508
|
-
enabled: boolean;
|
|
2509
|
-
/** {@link NavigationMode.id} */
|
|
2510
|
-
readonly id = "Orbit";
|
|
2511
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2512
|
-
/** {@link NavigationMode.set} */
|
|
2513
|
-
set(active: boolean): void;
|
|
2514
|
-
private activateOrbitControls;
|
|
2515
|
-
}
|
|
2516
|
-
import { NavigationMode } from "./types";
|
|
2517
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2518
|
-
/**
|
|
2519
|
-
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
2520
|
-
*/
|
|
2521
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
2522
|
-
private camera;
|
|
2523
|
-
/** {@link NavigationMode.enabled} */
|
|
2524
|
-
enabled: boolean;
|
|
2525
|
-
/** {@link NavigationMode.id} */
|
|
2526
|
-
readonly id = "FirstPerson";
|
|
2527
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2528
|
-
/** {@link NavigationMode.set} */
|
|
2529
|
-
set(active: boolean): void;
|
|
2530
|
-
private setupFirstPersonCamera;
|
|
2531
|
-
}
|
|
2532
|
-
import * as THREE from "three";
|
|
2533
|
-
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2534
|
-
import { Components } from "../../Components";
|
|
2535
|
-
/**
|
|
2536
|
-
* Configuration interface for the {@link SimpleGrid} class.
|
|
2537
|
-
*/
|
|
2538
|
-
export interface GridConfig {
|
|
2539
|
-
/**
|
|
2540
|
-
* The color of the grid lines.
|
|
2541
|
-
*/
|
|
2542
|
-
color: THREE.Color;
|
|
2543
|
-
/**
|
|
2544
|
-
* The size of the primary grid lines.
|
|
2545
|
-
*/
|
|
2546
|
-
size1: number;
|
|
2547
|
-
/**
|
|
2548
|
-
* The size of the secondary grid lines.
|
|
2549
|
-
*/
|
|
2550
|
-
size2: number;
|
|
2551
|
-
/**
|
|
2552
|
-
* The distance at which the grid lines start to fade away.
|
|
2553
|
-
*/
|
|
2554
|
-
distance: number;
|
|
2555
|
-
}
|
|
2556
|
-
/**
|
|
2557
|
-
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2558
|
-
*/
|
|
2559
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2560
|
-
/** {@link Disposable.onDisposed} */
|
|
2561
|
-
readonly onDisposed: Event<unknown>;
|
|
2562
|
-
/** The world instance to which this Raycaster belongs. */
|
|
2563
|
-
world: World;
|
|
2564
|
-
/** The components instance to which this grid belongs. */
|
|
2565
|
-
components: Components;
|
|
2566
|
-
/** {@link Hideable.visible} */
|
|
2567
|
-
get visible(): boolean;
|
|
2568
|
-
/** {@link Hideable.visible} */
|
|
2569
|
-
set visible(visible: boolean);
|
|
2570
|
-
/** The material of the grid. */
|
|
2571
|
-
get material(): THREE.ShaderMaterial;
|
|
2572
|
-
/**
|
|
2573
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2574
|
-
* perspective cameras and false for orthographic cameras.
|
|
2575
|
-
*/
|
|
2576
|
-
get fade(): boolean;
|
|
2577
|
-
/**
|
|
2578
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2579
|
-
* perspective cameras and false for orthographic cameras.
|
|
2580
|
-
*/
|
|
2581
|
-
set fade(active: boolean);
|
|
2582
|
-
/** The Three.js mesh that contains the infinite grid. */
|
|
2583
|
-
readonly three: THREE.Mesh;
|
|
2584
|
-
private _fade;
|
|
2585
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
2586
|
-
/** {@link Disposable.dispose} */
|
|
2587
|
-
dispose(): void;
|
|
2588
|
-
private setupEvents;
|
|
2589
|
-
private updateZoom;
|
|
2590
|
-
}
|
|
2591
|
-
import { NavigationMode } from "./types";
|
|
2592
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2593
|
-
/**
|
|
2594
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2595
|
-
*/
|
|
2596
|
-
export declare class PlanMode implements NavigationMode {
|
|
2597
|
-
private camera;
|
|
2598
|
-
/** {@link NavigationMode.enabled} */
|
|
2599
|
-
enabled: boolean;
|
|
2600
|
-
/** {@link NavigationMode.id} */
|
|
2601
|
-
readonly id = "Plan";
|
|
2602
|
-
private mouseAction1?;
|
|
2603
|
-
private mouseAction2?;
|
|
2604
|
-
private mouseInitialized;
|
|
2605
|
-
private readonly defaultAzimuthSpeed;
|
|
2606
|
-
private readonly defaultPolarSpeed;
|
|
2607
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2608
|
-
/** {@link NavigationMode.set} */
|
|
2609
|
-
set(active: boolean): void;
|
|
2610
|
-
}
|
|
2611
|
-
import * as THREE from "three";
|
|
2612
|
-
import { CameraProjection } from "./types";
|
|
2613
|
-
import { Event } from "../../Types";
|
|
2614
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2615
|
-
/**
|
|
2616
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2617
|
-
*/
|
|
2618
|
-
export declare class ProjectionManager {
|
|
2619
|
-
/**
|
|
2620
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
2621
|
-
*/
|
|
2622
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2623
|
-
/**
|
|
2624
|
-
* Current projection mode of the camera.
|
|
2625
|
-
* Default is "Perspective".
|
|
2626
|
-
*/
|
|
2627
|
-
current: CameraProjection;
|
|
2628
|
-
/**
|
|
2629
|
-
* The camera controlled by this ProjectionManager.
|
|
2630
|
-
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2631
|
-
*/
|
|
2632
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2633
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
2634
|
-
matchOrthoDistanceEnabled: boolean;
|
|
2635
|
-
private _component;
|
|
2636
|
-
private _previousDistance;
|
|
2637
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2638
|
-
/**
|
|
2639
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
2640
|
-
*
|
|
2641
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
2642
|
-
* it will have no effect.
|
|
2643
|
-
*/
|
|
2644
|
-
set(projection: CameraProjection): Promise<void>;
|
|
2645
|
-
/**
|
|
2646
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
2647
|
-
* and vice versa.
|
|
2648
|
-
*/
|
|
2649
|
-
toggle(): Promise<void>;
|
|
2650
|
-
private setOrthoCamera;
|
|
2651
|
-
private getPerspectiveDims;
|
|
2652
|
-
private setupOrthoCamera;
|
|
2653
|
-
private getDistance;
|
|
2654
|
-
private setPerspectiveCamera;
|
|
2655
|
-
}
|
|
2656
|
-
import * as THREE from "three";
|
|
2657
|
-
import { Components } from "../../Components";
|
|
2658
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
2659
|
-
/**
|
|
2660
|
-
* Settings to configure the CullerRenderer.
|
|
2661
|
-
*/
|
|
2662
|
-
export interface CullerRendererSettings {
|
|
2663
|
-
/**
|
|
2664
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
2665
|
-
* Default value is 1000.
|
|
2666
|
-
*/
|
|
2667
|
-
updateInterval?: number;
|
|
2668
|
-
/**
|
|
2669
|
-
* Width of the render target used for visibility checks.
|
|
2670
|
-
* Default value is 512.
|
|
2671
|
-
*/
|
|
2672
|
-
width?: number;
|
|
2673
|
-
/**
|
|
2674
|
-
* Height of the render target used for visibility checks.
|
|
2675
|
-
* Default value is 512.
|
|
2676
|
-
*/
|
|
2677
|
-
height?: number;
|
|
2678
|
-
/**
|
|
2679
|
-
* Whether the visibility check should be performed automatically.
|
|
2680
|
-
* Default value is true.
|
|
2681
|
-
*/
|
|
2682
|
-
autoUpdate?: boolean;
|
|
2683
|
-
}
|
|
2684
|
-
/**
|
|
2685
|
-
* A base renderer to determine visibility on screen.
|
|
2686
|
-
*/
|
|
2687
|
-
export declare class CullerRenderer {
|
|
2688
|
-
/** {@link Disposable.onDisposed} */
|
|
2689
|
-
readonly onDisposed: Event<string>;
|
|
2690
|
-
/**
|
|
2691
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
2692
|
-
* meshes that are currently visible, and the ones that were visible
|
|
2693
|
-
* just before but not anymore.
|
|
2694
|
-
*/
|
|
2695
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2696
|
-
/**
|
|
2697
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2698
|
-
*/
|
|
2699
|
-
enabled: boolean;
|
|
2700
|
-
/**
|
|
2701
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2702
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2703
|
-
*/
|
|
2704
|
-
needsUpdate: boolean;
|
|
2705
|
-
/**
|
|
2706
|
-
* Render the internal scene used to determine the object visibility. Used
|
|
2707
|
-
* for debugging purposes.
|
|
2708
|
-
*/
|
|
2709
|
-
renderDebugFrame: boolean;
|
|
2710
|
-
/** The components instance to which this renderer belongs. */
|
|
2711
|
-
components: Components;
|
|
2712
|
-
/** The world instance to which this renderer belongs. */
|
|
2713
|
-
readonly world: World;
|
|
2714
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
2715
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
2716
|
-
protected autoUpdate: boolean;
|
|
2717
|
-
protected updateInterval: number;
|
|
2718
|
-
protected readonly worker: Worker;
|
|
2719
|
-
protected readonly scene: THREE.Scene;
|
|
2720
|
-
private _width;
|
|
2721
|
-
private _height;
|
|
2722
|
-
private _availableColor;
|
|
2723
|
-
private readonly renderTarget;
|
|
2724
|
-
private readonly bufferSize;
|
|
2725
|
-
private readonly _buffer;
|
|
2726
|
-
protected _isWorkerBusy: boolean;
|
|
2727
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2728
|
-
/** {@link Disposable.dispose} */
|
|
2729
|
-
dispose(): void;
|
|
2498
|
+
/** {@link Resizeable.getSize} */
|
|
2499
|
+
abstract getSize(): Vector2;
|
|
2500
|
+
/** {@link Resizeable.resize} */
|
|
2501
|
+
abstract resize(size: Vector2 | undefined): void;
|
|
2730
2502
|
/**
|
|
2731
|
-
* The
|
|
2732
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
2733
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2734
|
-
* not true.
|
|
2503
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
2735
2504
|
*/
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2505
|
+
clippingPlanes: THREE.Plane[];
|
|
2506
|
+
/**
|
|
2507
|
+
* Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
|
|
2508
|
+
*
|
|
2509
|
+
* @remarks
|
|
2510
|
+
* This method is typically called when there is a change to the list of clipping planes
|
|
2511
|
+
* used by the active renderer.
|
|
2512
|
+
*/
|
|
2513
|
+
updateClippingPlanes(): void;
|
|
2514
|
+
/**
|
|
2515
|
+
* Sets or removes a clipping plane from the renderer.
|
|
2516
|
+
*
|
|
2517
|
+
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
2518
|
+
* @param plane - The clipping plane to be added or removed.
|
|
2519
|
+
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
|
|
2520
|
+
*
|
|
2521
|
+
* @remarks
|
|
2522
|
+
* This method adds or removes a clipping plane from the 'clippingPlanes' array.
|
|
2523
|
+
* If 'active' is 'true' and the plane is not already in the array, it is added.
|
|
2524
|
+
* If 'active' is 'false' and the plane is in the array, it is removed.
|
|
2525
|
+
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
2526
|
+
* excluding any planes marked as local.
|
|
2527
|
+
*/
|
|
2528
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2746
2529
|
}
|
|
2530
|
+
import * as THREE from "three";
|
|
2531
|
+
import { Disposable } from "./interfaces";
|
|
2532
|
+
import { Event } from "./event";
|
|
2533
|
+
import { Components } from "../../Components";
|
|
2534
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2747
2535
|
/**
|
|
2748
|
-
*
|
|
2749
|
-
*/
|
|
2750
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
2751
|
-
/**
|
|
2752
|
-
* The extensible list of supported navigation modes.
|
|
2753
|
-
*/
|
|
2754
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
2755
|
-
/**
|
|
2756
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2536
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2757
2537
|
*/
|
|
2758
|
-
export
|
|
2759
|
-
/**
|
|
2760
|
-
|
|
2538
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2539
|
+
/** {@link Disposable.onDisposed} */
|
|
2540
|
+
readonly onDisposed: Event<unknown>;
|
|
2761
2541
|
/**
|
|
2762
|
-
*
|
|
2763
|
-
*
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
set: (active: boolean, options?: any) => void;
|
|
2770
|
-
/** Whether this navigation mode is active or not. */
|
|
2771
|
-
enabled: boolean;
|
|
2542
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
2543
|
+
* It should be implemented by subclasses.
|
|
2544
|
+
*/
|
|
2545
|
+
abstract three: THREE.Object3D;
|
|
2546
|
+
protected constructor(components: Components);
|
|
2547
|
+
/** {@link Disposable.dispose} */
|
|
2548
|
+
dispose(): void;
|
|
2772
2549
|
}
|
|
2773
2550
|
import * as THREE from "three";
|
|
2774
|
-
import {
|
|
2775
|
-
import {
|
|
2776
|
-
import {
|
|
2551
|
+
import { BaseScene } from "./base-scene";
|
|
2552
|
+
import { BaseCamera } from "./base-camera";
|
|
2553
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2554
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2777
2555
|
/**
|
|
2778
|
-
*
|
|
2556
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2779
2557
|
*/
|
|
2780
|
-
export
|
|
2558
|
+
export interface World extends Disposable, Updateable {
|
|
2781
2559
|
/**
|
|
2782
|
-
*
|
|
2783
|
-
* Contains two sets: seen and unseen.
|
|
2560
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2784
2561
|
*/
|
|
2785
|
-
|
|
2786
|
-
seen: Set<THREE.Mesh>;
|
|
2787
|
-
unseen: Set<THREE.Mesh>;
|
|
2788
|
-
}>;
|
|
2562
|
+
meshes: Set<THREE.Mesh>;
|
|
2789
2563
|
/**
|
|
2790
|
-
*
|
|
2791
|
-
* Default value is 100.
|
|
2564
|
+
* The base scene of the world.
|
|
2792
2565
|
*/
|
|
2793
|
-
|
|
2566
|
+
scene: BaseScene;
|
|
2794
2567
|
/**
|
|
2795
|
-
*
|
|
2796
|
-
* Used to keep track of color-coded meshes.
|
|
2568
|
+
* The base camera of the world.
|
|
2797
2569
|
*/
|
|
2798
|
-
|
|
2570
|
+
camera: BaseCamera;
|
|
2799
2571
|
/**
|
|
2800
|
-
*
|
|
2801
|
-
* Used to prevent concurrent processing.
|
|
2572
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2802
2573
|
*/
|
|
2803
|
-
|
|
2804
|
-
private _colorCodeMeshMap;
|
|
2805
|
-
private _meshIDColorCodeMap;
|
|
2806
|
-
private _currentVisibleMeshes;
|
|
2807
|
-
private _recentlyHiddenMeshes;
|
|
2808
|
-
private _intervalID;
|
|
2809
|
-
private readonly _transparentMat;
|
|
2810
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2811
|
-
/** {@link Disposable.dispose} */
|
|
2812
|
-
dispose(): void;
|
|
2574
|
+
renderer: BaseRenderer | null;
|
|
2813
2575
|
/**
|
|
2814
|
-
*
|
|
2815
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2816
|
-
* @returns {void}
|
|
2576
|
+
* A unique identifier for the world.
|
|
2817
2577
|
*/
|
|
2818
|
-
|
|
2578
|
+
uuid: string;
|
|
2819
2579
|
/**
|
|
2820
|
-
*
|
|
2821
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2822
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2823
|
-
* @returns {void}
|
|
2580
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2824
2581
|
*/
|
|
2825
|
-
|
|
2826
|
-
private handleWorkerMessage;
|
|
2827
|
-
private getAvailableMaterial;
|
|
2582
|
+
isDisposing: boolean;
|
|
2828
2583
|
}
|
|
2829
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2830
2584
|
import * as THREE from "three";
|
|
2831
2585
|
import { Disposable, Event } from "../../Types";
|
|
2832
2586
|
/**
|
|
@@ -2888,39 +2642,135 @@ export declare class SimpleRaycaster implements Disposable {
|
|
|
2888
2642
|
* to query. If not provided, it will query all the meshes stored in
|
|
2889
2643
|
* {@link Components.meshes}.
|
|
2890
2644
|
*/
|
|
2891
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2645
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2646
|
+
/**
|
|
2647
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2648
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2649
|
+
*
|
|
2650
|
+
* @param origin - The origin of the ray.
|
|
2651
|
+
* @param direction - The direction of the ray.
|
|
2652
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2653
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2654
|
+
*/
|
|
2655
|
+
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;
|
|
2656
|
+
private intersect;
|
|
2657
|
+
private filterClippingPlanes;
|
|
2658
|
+
}
|
|
2659
|
+
import * as THREE from "three";
|
|
2660
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2661
|
+
import { Components } from "../../Components";
|
|
2662
|
+
/**
|
|
2663
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2664
|
+
*/
|
|
2665
|
+
export interface GridConfig {
|
|
2666
|
+
/**
|
|
2667
|
+
* The color of the grid lines.
|
|
2668
|
+
*/
|
|
2669
|
+
color: THREE.Color;
|
|
2670
|
+
/**
|
|
2671
|
+
* The size of the primary grid lines.
|
|
2672
|
+
*/
|
|
2673
|
+
size1: number;
|
|
2674
|
+
/**
|
|
2675
|
+
* The size of the secondary grid lines.
|
|
2676
|
+
*/
|
|
2677
|
+
size2: number;
|
|
2678
|
+
/**
|
|
2679
|
+
* The distance at which the grid lines start to fade away.
|
|
2680
|
+
*/
|
|
2681
|
+
distance: number;
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2685
|
+
*/
|
|
2686
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2687
|
+
/** {@link Disposable.onDisposed} */
|
|
2688
|
+
readonly onDisposed: Event<unknown>;
|
|
2689
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2690
|
+
world: World;
|
|
2691
|
+
/** The components instance to which this grid belongs. */
|
|
2692
|
+
components: Components;
|
|
2693
|
+
/** {@link Hideable.visible} */
|
|
2694
|
+
get visible(): boolean;
|
|
2695
|
+
/** {@link Hideable.visible} */
|
|
2696
|
+
set visible(visible: boolean);
|
|
2697
|
+
/** The material of the grid. */
|
|
2698
|
+
get material(): THREE.ShaderMaterial;
|
|
2699
|
+
/**
|
|
2700
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2701
|
+
* perspective cameras and false for orthographic cameras.
|
|
2702
|
+
*/
|
|
2703
|
+
get fade(): boolean;
|
|
2704
|
+
/**
|
|
2705
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2706
|
+
* perspective cameras and false for orthographic cameras.
|
|
2707
|
+
*/
|
|
2708
|
+
set fade(active: boolean);
|
|
2709
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2710
|
+
readonly three: THREE.Mesh;
|
|
2711
|
+
private _fade;
|
|
2712
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2713
|
+
/** {@link Disposable.dispose} */
|
|
2714
|
+
dispose(): void;
|
|
2715
|
+
private setupEvents;
|
|
2716
|
+
private updateZoom;
|
|
2717
|
+
}
|
|
2718
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2719
|
+
import * as THREE from "three";
|
|
2720
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2721
|
+
import { Components } from "../../Components";
|
|
2722
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2723
|
+
/**
|
|
2724
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2725
|
+
*/
|
|
2726
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2727
|
+
/**
|
|
2728
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2729
|
+
* Contains two sets: seen and unseen.
|
|
2730
|
+
*/
|
|
2731
|
+
readonly onViewUpdated: Event<{
|
|
2732
|
+
seen: Set<THREE.Mesh>;
|
|
2733
|
+
unseen: Set<THREE.Mesh>;
|
|
2734
|
+
}>;
|
|
2735
|
+
/**
|
|
2736
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2737
|
+
* Default value is 100.
|
|
2738
|
+
*/
|
|
2739
|
+
threshold: number;
|
|
2740
|
+
/**
|
|
2741
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2742
|
+
* Used to keep track of color-coded meshes.
|
|
2743
|
+
*/
|
|
2744
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2745
|
+
/**
|
|
2746
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2747
|
+
* Used to prevent concurrent processing.
|
|
2748
|
+
*/
|
|
2749
|
+
isProcessing: boolean;
|
|
2750
|
+
private _colorCodeMeshMap;
|
|
2751
|
+
private _meshIDColorCodeMap;
|
|
2752
|
+
private _currentVisibleMeshes;
|
|
2753
|
+
private _recentlyHiddenMeshes;
|
|
2754
|
+
private _intervalID;
|
|
2755
|
+
private readonly _transparentMat;
|
|
2756
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2757
|
+
/** {@link Disposable.dispose} */
|
|
2758
|
+
dispose(): void;
|
|
2759
|
+
/**
|
|
2760
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
2761
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2762
|
+
* @returns {void}
|
|
2763
|
+
*/
|
|
2764
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2892
2765
|
/**
|
|
2893
|
-
*
|
|
2894
|
-
*
|
|
2895
|
-
*
|
|
2896
|
-
* @
|
|
2897
|
-
* @param direction - The direction of the ray.
|
|
2898
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2899
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2766
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2767
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2768
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2769
|
+
* @returns {void}
|
|
2900
2770
|
*/
|
|
2901
|
-
|
|
2902
|
-
private
|
|
2903
|
-
private
|
|
2904
|
-
}
|
|
2905
|
-
import * as THREE from "three";
|
|
2906
|
-
import * as WEBIFC from "web-ifc";
|
|
2907
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2908
|
-
export declare class CivilReader {
|
|
2909
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
2910
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
2911
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2912
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2913
|
-
} | undefined;
|
|
2914
|
-
get(civilItems: any): {
|
|
2915
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2916
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2917
|
-
} | undefined;
|
|
2918
|
-
private getCurves;
|
|
2919
|
-
}
|
|
2920
|
-
import * as WEBIFC from "web-ifc";
|
|
2921
|
-
export declare class IfcMetadataReader {
|
|
2922
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2923
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2771
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2772
|
+
private handleWorkerMessage;
|
|
2773
|
+
private getAvailableMaterial;
|
|
2924
2774
|
}
|
|
2925
2775
|
import * as THREE from "three";
|
|
2926
2776
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -3002,6 +2852,151 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
3002
2852
|
dispose(disposeResources?: boolean): void;
|
|
3003
2853
|
}
|
|
3004
2854
|
import * as THREE from "three";
|
|
2855
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
2856
|
+
import { Components } from "../../Components";
|
|
2857
|
+
/**
|
|
2858
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2859
|
+
*/
|
|
2860
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
2861
|
+
/**
|
|
2862
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2863
|
+
* Default is 'true'.
|
|
2864
|
+
*/
|
|
2865
|
+
enabled: boolean;
|
|
2866
|
+
/**
|
|
2867
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2868
|
+
*/
|
|
2869
|
+
container: HTMLElement;
|
|
2870
|
+
/**
|
|
2871
|
+
* The THREE.js WebGLRenderer instance.
|
|
2872
|
+
*/
|
|
2873
|
+
three: THREE.WebGLRenderer;
|
|
2874
|
+
protected _canvas: HTMLCanvasElement;
|
|
2875
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2876
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
2877
|
+
protected onContainerUpdated: Event<unknown>;
|
|
2878
|
+
private _resizing;
|
|
2879
|
+
/**
|
|
2880
|
+
* Constructor for the SimpleRenderer class.
|
|
2881
|
+
*
|
|
2882
|
+
* @param components - The components instance.
|
|
2883
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2884
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2885
|
+
*/
|
|
2886
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2887
|
+
/** {@link Updateable.update} */
|
|
2888
|
+
update(): void;
|
|
2889
|
+
/** {@link Disposable.dispose} */
|
|
2890
|
+
dispose(): void;
|
|
2891
|
+
/** {@link Resizeable.getSize}. */
|
|
2892
|
+
getSize(): THREE.Vector2;
|
|
2893
|
+
/** {@link Resizeable.resize} */
|
|
2894
|
+
resize: (size?: THREE.Vector2) => void;
|
|
2895
|
+
/**
|
|
2896
|
+
* Sets up and manages the event listeners for the renderer.
|
|
2897
|
+
*
|
|
2898
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2899
|
+
*
|
|
2900
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2901
|
+
*/
|
|
2902
|
+
setupEvents(active: boolean): void;
|
|
2903
|
+
private resizeEvent;
|
|
2904
|
+
private setupRenderer;
|
|
2905
|
+
private onContextLost;
|
|
2906
|
+
private onContextBack;
|
|
2907
|
+
}
|
|
2908
|
+
import * as THREE from "three";
|
|
2909
|
+
import { Components } from "../../Components";
|
|
2910
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
2911
|
+
/**
|
|
2912
|
+
* Settings to configure the CullerRenderer.
|
|
2913
|
+
*/
|
|
2914
|
+
export interface CullerRendererSettings {
|
|
2915
|
+
/**
|
|
2916
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
2917
|
+
* Default value is 1000.
|
|
2918
|
+
*/
|
|
2919
|
+
updateInterval?: number;
|
|
2920
|
+
/**
|
|
2921
|
+
* Width of the render target used for visibility checks.
|
|
2922
|
+
* Default value is 512.
|
|
2923
|
+
*/
|
|
2924
|
+
width?: number;
|
|
2925
|
+
/**
|
|
2926
|
+
* Height of the render target used for visibility checks.
|
|
2927
|
+
* Default value is 512.
|
|
2928
|
+
*/
|
|
2929
|
+
height?: number;
|
|
2930
|
+
/**
|
|
2931
|
+
* Whether the visibility check should be performed automatically.
|
|
2932
|
+
* Default value is true.
|
|
2933
|
+
*/
|
|
2934
|
+
autoUpdate?: boolean;
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* A base renderer to determine visibility on screen.
|
|
2938
|
+
*/
|
|
2939
|
+
export declare class CullerRenderer {
|
|
2940
|
+
/** {@link Disposable.onDisposed} */
|
|
2941
|
+
readonly onDisposed: Event<string>;
|
|
2942
|
+
/**
|
|
2943
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2944
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2945
|
+
* just before but not anymore.
|
|
2946
|
+
*/
|
|
2947
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2950
|
+
*/
|
|
2951
|
+
enabled: boolean;
|
|
2952
|
+
/**
|
|
2953
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2954
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2955
|
+
*/
|
|
2956
|
+
needsUpdate: boolean;
|
|
2957
|
+
/**
|
|
2958
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2959
|
+
* for debugging purposes.
|
|
2960
|
+
*/
|
|
2961
|
+
renderDebugFrame: boolean;
|
|
2962
|
+
/** The components instance to which this renderer belongs. */
|
|
2963
|
+
components: Components;
|
|
2964
|
+
/** The world instance to which this renderer belongs. */
|
|
2965
|
+
readonly world: World;
|
|
2966
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2967
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2968
|
+
protected autoUpdate: boolean;
|
|
2969
|
+
protected updateInterval: number;
|
|
2970
|
+
protected readonly worker: Worker;
|
|
2971
|
+
protected readonly scene: THREE.Scene;
|
|
2972
|
+
private _width;
|
|
2973
|
+
private _height;
|
|
2974
|
+
private _availableColor;
|
|
2975
|
+
private readonly renderTarget;
|
|
2976
|
+
private readonly bufferSize;
|
|
2977
|
+
private readonly _buffer;
|
|
2978
|
+
protected _isWorkerBusy: boolean;
|
|
2979
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2980
|
+
/** {@link Disposable.dispose} */
|
|
2981
|
+
dispose(): void;
|
|
2982
|
+
/**
|
|
2983
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2984
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2985
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2986
|
+
* not true.
|
|
2987
|
+
*/
|
|
2988
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
2989
|
+
protected getAvailableColor(): {
|
|
2990
|
+
r: number;
|
|
2991
|
+
g: number;
|
|
2992
|
+
b: number;
|
|
2993
|
+
code: string;
|
|
2994
|
+
};
|
|
2995
|
+
protected increaseColor(): void;
|
|
2996
|
+
protected decreaseColor(): void;
|
|
2997
|
+
private applySettings;
|
|
2998
|
+
}
|
|
2999
|
+
import * as THREE from "three";
|
|
3005
3000
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3006
3001
|
import { Components } from "../../Components";
|
|
3007
3002
|
/**
|
|
@@ -3032,75 +3027,33 @@ export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
|
3032
3027
|
/** {@link Configurable.onSetup} */
|
|
3033
3028
|
readonly onSetup: Event<SimpleScene>;
|
|
3034
3029
|
/**
|
|
3035
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
3036
|
-
* Defines properties for directional and ambient lights.
|
|
3037
|
-
*/
|
|
3038
|
-
config: Required<SimpleSceneConfig>;
|
|
3039
|
-
constructor(components: Components);
|
|
3040
|
-
/** {@link Configurable.setup} */
|
|
3041
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3042
|
-
}
|
|
3043
|
-
import * as THREE from "three";
|
|
3044
|
-
import
|
|
3045
|
-
import
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
/**
|
|
3063
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3064
|
-
* This camera is used for rendering the scene.
|
|
3065
|
-
*/
|
|
3066
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3067
|
-
private _allControls;
|
|
3068
|
-
/**
|
|
3069
|
-
* The object that controls the camera. An instance of
|
|
3070
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3071
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
3072
|
-
* object to move, rotate, look at objects, etc.
|
|
3073
|
-
*/
|
|
3074
|
-
get controls(): CameraControls;
|
|
3075
|
-
/**
|
|
3076
|
-
* Getter for the enabled state of the camera controls.
|
|
3077
|
-
* If the current world is null, it returns false.
|
|
3078
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
3079
|
-
*
|
|
3080
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
3081
|
-
*/
|
|
3082
|
-
get enabled(): boolean;
|
|
3083
|
-
/**
|
|
3084
|
-
* Setter for the enabled state of the camera controls.
|
|
3085
|
-
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3086
|
-
*
|
|
3087
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3088
|
-
*/
|
|
3089
|
-
set enabled(enabled: boolean);
|
|
3090
|
-
constructor(components: Components);
|
|
3091
|
-
/** {@link Disposable.dispose} */
|
|
3092
|
-
dispose(): void;
|
|
3093
|
-
/** {@link Updateable.update} */
|
|
3094
|
-
update(_delta: number): void;
|
|
3095
|
-
/**
|
|
3096
|
-
* Updates the aspect of the camera to match the size of the
|
|
3097
|
-
* {@link Components.renderer}.
|
|
3098
|
-
*/
|
|
3099
|
-
updateAspect: () => void;
|
|
3100
|
-
private setupCamera;
|
|
3101
|
-
private newCameraControls;
|
|
3102
|
-
private setupEvents;
|
|
3103
|
-
private static getSubsetOfThree;
|
|
3030
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3031
|
+
* Defines properties for directional and ambient lights.
|
|
3032
|
+
*/
|
|
3033
|
+
config: Required<SimpleSceneConfig>;
|
|
3034
|
+
constructor(components: Components);
|
|
3035
|
+
/** {@link Configurable.setup} */
|
|
3036
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3037
|
+
}
|
|
3038
|
+
import * as THREE from "three";
|
|
3039
|
+
import * as WEBIFC from "web-ifc";
|
|
3040
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3041
|
+
export declare class CivilReader {
|
|
3042
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3043
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3044
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3045
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3046
|
+
} | undefined;
|
|
3047
|
+
get(civilItems: any): {
|
|
3048
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3049
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3050
|
+
} | undefined;
|
|
3051
|
+
private getCurves;
|
|
3052
|
+
}
|
|
3053
|
+
import * as WEBIFC from "web-ifc";
|
|
3054
|
+
export declare class IfcMetadataReader {
|
|
3055
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3056
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3104
3057
|
}
|
|
3105
3058
|
import * as THREE from "three";
|
|
3106
3059
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
@@ -3200,58 +3153,183 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3200
3153
|
private static newPlaneMesh;
|
|
3201
3154
|
}
|
|
3202
3155
|
import * as THREE from "three";
|
|
3203
|
-
import
|
|
3156
|
+
import CameraControls from "camera-controls";
|
|
3157
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3204
3158
|
import { Components } from "../../Components";
|
|
3205
3159
|
/**
|
|
3206
|
-
* A basic
|
|
3160
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
3207
3161
|
*/
|
|
3208
|
-
export declare class
|
|
3162
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3163
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3164
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3165
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3166
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3209
3167
|
/**
|
|
3210
|
-
*
|
|
3211
|
-
*
|
|
3168
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3169
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3212
3170
|
*/
|
|
3213
|
-
|
|
3171
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3172
|
+
/** {@link Disposable.onDisposed} */
|
|
3173
|
+
readonly onDisposed: Event<string>;
|
|
3214
3174
|
/**
|
|
3215
|
-
*
|
|
3175
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3176
|
+
* This camera is used for rendering the scene.
|
|
3216
3177
|
*/
|
|
3217
|
-
|
|
3178
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3179
|
+
private _allControls;
|
|
3218
3180
|
/**
|
|
3219
|
-
* The
|
|
3181
|
+
* The object that controls the camera. An instance of
|
|
3182
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3183
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3184
|
+
* object to move, rotate, look at objects, etc.
|
|
3220
3185
|
*/
|
|
3221
|
-
|
|
3222
|
-
protected _canvas: HTMLCanvasElement;
|
|
3223
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3224
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
3225
|
-
protected onContainerUpdated: Event<unknown>;
|
|
3226
|
-
private _resizing;
|
|
3186
|
+
get controls(): CameraControls;
|
|
3227
3187
|
/**
|
|
3228
|
-
*
|
|
3188
|
+
* Getter for the enabled state of the camera controls.
|
|
3189
|
+
* If the current world is null, it returns false.
|
|
3190
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3229
3191
|
*
|
|
3230
|
-
* @
|
|
3231
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3232
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3192
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3233
3193
|
*/
|
|
3234
|
-
|
|
3235
|
-
/**
|
|
3236
|
-
|
|
3194
|
+
get enabled(): boolean;
|
|
3195
|
+
/**
|
|
3196
|
+
* Setter for the enabled state of the camera controls.
|
|
3197
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3198
|
+
*
|
|
3199
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3200
|
+
*/
|
|
3201
|
+
set enabled(enabled: boolean);
|
|
3202
|
+
constructor(components: Components);
|
|
3237
3203
|
/** {@link Disposable.dispose} */
|
|
3238
3204
|
dispose(): void;
|
|
3239
|
-
/** {@link
|
|
3240
|
-
|
|
3241
|
-
/** {@link Resizeable.resize} */
|
|
3242
|
-
resize: (size?: THREE.Vector2) => void;
|
|
3205
|
+
/** {@link Updateable.update} */
|
|
3206
|
+
update(_delta: number): void;
|
|
3243
3207
|
/**
|
|
3244
|
-
*
|
|
3208
|
+
* Updates the aspect of the camera to match the size of the
|
|
3209
|
+
* {@link Components.renderer}.
|
|
3210
|
+
*/
|
|
3211
|
+
updateAspect: () => void;
|
|
3212
|
+
private setupCamera;
|
|
3213
|
+
private newCameraControls;
|
|
3214
|
+
private setupEvents;
|
|
3215
|
+
private static getSubsetOfThree;
|
|
3216
|
+
}
|
|
3217
|
+
import { NavigationMode } from "./types";
|
|
3218
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3219
|
+
/**
|
|
3220
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3221
|
+
*/
|
|
3222
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3223
|
+
private camera;
|
|
3224
|
+
/** {@link NavigationMode.enabled} */
|
|
3225
|
+
enabled: boolean;
|
|
3226
|
+
/** {@link NavigationMode.id} */
|
|
3227
|
+
readonly id = "FirstPerson";
|
|
3228
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3229
|
+
/** {@link NavigationMode.set} */
|
|
3230
|
+
set(active: boolean): void;
|
|
3231
|
+
private setupFirstPersonCamera;
|
|
3232
|
+
}
|
|
3233
|
+
import * as WEBIFC from "web-ifc";
|
|
3234
|
+
import * as THREE from "three";
|
|
3235
|
+
export declare class Units {
|
|
3236
|
+
factor: number;
|
|
3237
|
+
complement: number;
|
|
3238
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3239
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3240
|
+
private getLengthUnits;
|
|
3241
|
+
private getScaleMatrix;
|
|
3242
|
+
}
|
|
3243
|
+
import { NavigationMode } from "./types";
|
|
3244
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3245
|
+
/**
|
|
3246
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3247
|
+
*/
|
|
3248
|
+
export declare class PlanMode implements NavigationMode {
|
|
3249
|
+
private camera;
|
|
3250
|
+
/** {@link NavigationMode.enabled} */
|
|
3251
|
+
enabled: boolean;
|
|
3252
|
+
/** {@link NavigationMode.id} */
|
|
3253
|
+
readonly id = "Plan";
|
|
3254
|
+
private mouseAction1?;
|
|
3255
|
+
private mouseAction2?;
|
|
3256
|
+
private mouseInitialized;
|
|
3257
|
+
private readonly defaultAzimuthSpeed;
|
|
3258
|
+
private readonly defaultPolarSpeed;
|
|
3259
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3260
|
+
/** {@link NavigationMode.set} */
|
|
3261
|
+
set(active: boolean): void;
|
|
3262
|
+
}
|
|
3263
|
+
/**
|
|
3264
|
+
* The projection system of the camera.
|
|
3265
|
+
*/
|
|
3266
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3267
|
+
/**
|
|
3268
|
+
* The extensible list of supported navigation modes.
|
|
3269
|
+
*/
|
|
3270
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3271
|
+
/**
|
|
3272
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3273
|
+
*/
|
|
3274
|
+
export interface NavigationMode {
|
|
3275
|
+
/** The unique ID of this navigation mode. */
|
|
3276
|
+
id: NavModeID;
|
|
3277
|
+
/**
|
|
3278
|
+
* Enable or disable this navigation mode.
|
|
3279
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3280
|
+
* must be disabled.
|
|
3245
3281
|
*
|
|
3246
|
-
* @param active -
|
|
3282
|
+
* @param active - whether to enable or disable this mode.
|
|
3283
|
+
* @param options - any additional data required to enable or disable it.
|
|
3284
|
+
* */
|
|
3285
|
+
set: (active: boolean, options?: any) => void;
|
|
3286
|
+
/** Whether this navigation mode is active or not. */
|
|
3287
|
+
enabled: boolean;
|
|
3288
|
+
}
|
|
3289
|
+
import * as THREE from "three";
|
|
3290
|
+
import { CameraProjection } from "./types";
|
|
3291
|
+
import { Event } from "../../Types";
|
|
3292
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3293
|
+
/**
|
|
3294
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3295
|
+
*/
|
|
3296
|
+
export declare class ProjectionManager {
|
|
3297
|
+
/**
|
|
3298
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3299
|
+
*/
|
|
3300
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3301
|
+
/**
|
|
3302
|
+
* Current projection mode of the camera.
|
|
3303
|
+
* Default is "Perspective".
|
|
3304
|
+
*/
|
|
3305
|
+
current: CameraProjection;
|
|
3306
|
+
/**
|
|
3307
|
+
* The camera controlled by this ProjectionManager.
|
|
3308
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3309
|
+
*/
|
|
3310
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3311
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3312
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3313
|
+
private _component;
|
|
3314
|
+
private _previousDistance;
|
|
3315
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3316
|
+
/**
|
|
3317
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3247
3318
|
*
|
|
3248
|
-
* @
|
|
3319
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3320
|
+
* it will have no effect.
|
|
3249
3321
|
*/
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3322
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3323
|
+
/**
|
|
3324
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3325
|
+
* and vice versa.
|
|
3326
|
+
*/
|
|
3327
|
+
toggle(): Promise<void>;
|
|
3328
|
+
private setOrthoCamera;
|
|
3329
|
+
private getPerspectiveDims;
|
|
3330
|
+
private setupOrthoCamera;
|
|
3331
|
+
private getDistance;
|
|
3332
|
+
private setPerspectiveCamera;
|
|
3255
3333
|
}
|
|
3256
3334
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3257
3335
|
/**
|
|
@@ -3269,16 +3347,6 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
|
3269
3347
|
*/
|
|
3270
3348
|
minAssetsSize: number;
|
|
3271
3349
|
}
|
|
3272
|
-
import * as WEBIFC from "web-ifc";
|
|
3273
|
-
import * as THREE from "three";
|
|
3274
|
-
export declare class Units {
|
|
3275
|
-
factor: number;
|
|
3276
|
-
complement: number;
|
|
3277
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3278
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3279
|
-
private getLengthUnits;
|
|
3280
|
-
private getScaleMatrix;
|
|
3281
|
-
}
|
|
3282
3350
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3283
3351
|
export interface ModelsRelationMap {
|
|
3284
3352
|
[modelID: string]: RelationsMap;
|
|
@@ -3314,6 +3382,27 @@ export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
|
3314
3382
|
*/
|
|
3315
3383
|
propertiesSize: number;
|
|
3316
3384
|
}
|
|
3385
|
+
import { NavigationMode } from "./types";
|
|
3386
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3387
|
+
/**
|
|
3388
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3389
|
+
*/
|
|
3390
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3391
|
+
camera: OrthoPerspectiveCamera;
|
|
3392
|
+
/** {@link NavigationMode.enabled} */
|
|
3393
|
+
enabled: boolean;
|
|
3394
|
+
/** {@link NavigationMode.id} */
|
|
3395
|
+
readonly id = "Orbit";
|
|
3396
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3397
|
+
/** {@link NavigationMode.set} */
|
|
3398
|
+
set(active: boolean): void;
|
|
3399
|
+
private activateOrbitControls;
|
|
3400
|
+
}
|
|
3401
|
+
import { BufferGeometry } from "three";
|
|
3402
|
+
import * as THREE from "three";
|
|
3403
|
+
export declare class TransformHelper {
|
|
3404
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3405
|
+
}
|
|
3317
3406
|
/**
|
|
3318
3407
|
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3319
3408
|
*/
|
|
@@ -3343,10 +3432,5 @@ export interface StreamedAsset {
|
|
|
3343
3432
|
color: number[];
|
|
3344
3433
|
}[];
|
|
3345
3434
|
}
|
|
3346
|
-
import { BufferGeometry } from "three";
|
|
3347
|
-
import * as THREE from "three";
|
|
3348
|
-
export declare class TransformHelper {
|
|
3349
|
-
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3350
|
-
}
|
|
3351
3435
|
|
|
3352
3436
|
}
|