@thatopen/components 2.1.19 → 2.1.21
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/core/ShadowedScene/index.d.ts +59 -0
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +67 -0
- package/dist/core/ShadowedScene/src/index.d.ts +1 -0
- package/dist/core/Types/src/base-scene.d.ts +4 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +4 -2
- package/dist/index.cjs +61 -21
- package/dist/index.mjs +3286 -2970
- package/dist/namespace.d.ts +1687 -1555
- package/package.json +2 -2
package/dist/namespace.d.ts
CHANGED
|
@@ -1,4 +1,139 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
3
|
+
/**
|
|
4
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Components implements Disposable {
|
|
7
|
+
/**
|
|
8
|
+
* The version of the @thatopen/components library.
|
|
9
|
+
*/
|
|
10
|
+
static readonly release = "2.1.21";
|
|
11
|
+
/** {@link Disposable.onDisposed} */
|
|
12
|
+
readonly onDisposed: Event<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The list of components created in this app.
|
|
15
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
16
|
+
*/
|
|
17
|
+
readonly list: Map<string, Component>;
|
|
18
|
+
/**
|
|
19
|
+
* If disabled, the animation loop will be stopped.
|
|
20
|
+
* Default value is false.
|
|
21
|
+
*/
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
private _clock;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a component to the list of components.
|
|
26
|
+
* Throws an error if a component with the same UUID already exists.
|
|
27
|
+
*
|
|
28
|
+
* @param uuid - The unique identifier of the component.
|
|
29
|
+
* @param instance - The instance of the component to be added.
|
|
30
|
+
*
|
|
31
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
add(uuid: string, instance: Component): void;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a component instance by its constructor function.
|
|
38
|
+
* If the component does not exist in the list, it will be created and added.
|
|
39
|
+
*
|
|
40
|
+
* @template U - The type of the component to retrieve.
|
|
41
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
42
|
+
*
|
|
43
|
+
* @returns The instance of the requested component.
|
|
44
|
+
*
|
|
45
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
50
|
+
constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the Components instance.
|
|
53
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
54
|
+
* and calls the update method.
|
|
55
|
+
*
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
init(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
61
|
+
* the library. A memory leak will be created if:
|
|
62
|
+
*
|
|
63
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
64
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
65
|
+
* Angular, Vue, etc).
|
|
66
|
+
*
|
|
67
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
68
|
+
* referenced by a reference type (object or array).
|
|
69
|
+
*
|
|
70
|
+
* You can learn more about how Three.js handles memory leaks
|
|
71
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
dispose(): void;
|
|
75
|
+
private update;
|
|
76
|
+
private static setupBVH;
|
|
77
|
+
}
|
|
78
|
+
import { SimpleScene, SimpleSceneConfig } from "../Worlds";
|
|
79
|
+
import { DistanceRenderer } from "./src";
|
|
80
|
+
import { Disposable } from "../Types";
|
|
81
|
+
/**
|
|
82
|
+
* Configuration interface for the {@link ShadowedScene}. Defines properties for directional and ambient lights,
|
|
83
|
+
* as well as shadows.
|
|
84
|
+
*/
|
|
85
|
+
export interface ShadowedSceneConfig extends SimpleSceneConfig {
|
|
86
|
+
shadows: {
|
|
87
|
+
cascade: number;
|
|
88
|
+
resolution: number;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A scene that supports efficient cast shadows.
|
|
93
|
+
*/
|
|
94
|
+
export declare class ShadowedScene extends SimpleScene implements Disposable {
|
|
95
|
+
private _distanceRenderer?;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the bias property should be set automatically depending on the shadow distance.
|
|
98
|
+
*/
|
|
99
|
+
autoBias: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Configuration interface for the {@link ShadowedScene}.
|
|
102
|
+
* Defines properties for directional and ambient lights, as well as shadows.
|
|
103
|
+
*/
|
|
104
|
+
config: Required<ShadowedSceneConfig>;
|
|
105
|
+
private _lightsWithShadow;
|
|
106
|
+
private _isComputingShadows;
|
|
107
|
+
private _shadowsEnabled;
|
|
108
|
+
private _bias;
|
|
109
|
+
/**
|
|
110
|
+
* The getter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
111
|
+
*/
|
|
112
|
+
get bias(): number;
|
|
113
|
+
/**
|
|
114
|
+
* The setter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
|
|
115
|
+
*/
|
|
116
|
+
set bias(value: number);
|
|
117
|
+
/**
|
|
118
|
+
* Getter to see whether the shadows are enabled or not in this scene instance.
|
|
119
|
+
*/
|
|
120
|
+
get shadowsEnabled(): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Setter to control whether the shadows are enabled or not in this scene instance.
|
|
123
|
+
*/
|
|
124
|
+
set shadowsEnabled(value: boolean);
|
|
125
|
+
/**
|
|
126
|
+
* Getter to get the renderer used to determine the farthest distance from the camera.
|
|
127
|
+
*/
|
|
128
|
+
get distanceRenderer(): DistanceRenderer;
|
|
129
|
+
/** {@link Configurable.setup} */
|
|
130
|
+
setup(config?: Partial<ShadowedSceneConfig>): void;
|
|
131
|
+
/** {@link Disposable.dispose} */
|
|
132
|
+
dispose(): void;
|
|
133
|
+
/** Update all the shadows of the scene. */
|
|
134
|
+
updateShadows(): Promise<void>;
|
|
135
|
+
private recomputeShadows;
|
|
136
|
+
}
|
|
2
137
|
import * as THREE from "three";
|
|
3
138
|
import { Components } from "../Components";
|
|
4
139
|
import { Component } from "../Types";
|
|
@@ -44,6 +179,63 @@ export declare class Disposer extends Component {
|
|
|
44
179
|
private disposeChildren;
|
|
45
180
|
private static disposeMaterial;
|
|
46
181
|
}
|
|
182
|
+
import * as THREE from "three";
|
|
183
|
+
import { Components } from "../Components";
|
|
184
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
185
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
186
|
+
/**
|
|
187
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
188
|
+
*/
|
|
189
|
+
export declare class Cullers extends Component implements Disposable {
|
|
190
|
+
/**
|
|
191
|
+
* A unique identifier for the component.
|
|
192
|
+
* This UUID is used to register the component within the Components system.
|
|
193
|
+
*/
|
|
194
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
195
|
+
/**
|
|
196
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
197
|
+
*/
|
|
198
|
+
readonly onDisposed: Event<unknown>;
|
|
199
|
+
private _enabled;
|
|
200
|
+
/**
|
|
201
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
202
|
+
*/
|
|
203
|
+
list: Map<string, MeshCullerRenderer>;
|
|
204
|
+
/** {@link Component.enabled} */
|
|
205
|
+
get enabled(): boolean;
|
|
206
|
+
/** {@link Component.enabled} */
|
|
207
|
+
set enabled(value: boolean);
|
|
208
|
+
constructor(components: Components);
|
|
209
|
+
/**
|
|
210
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
211
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
212
|
+
*
|
|
213
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
214
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
215
|
+
*
|
|
216
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
217
|
+
*/
|
|
218
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
219
|
+
/**
|
|
220
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
221
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
222
|
+
*
|
|
223
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
224
|
+
*
|
|
225
|
+
* @returns {void}
|
|
226
|
+
*/
|
|
227
|
+
delete(world: World): void;
|
|
228
|
+
/** {@link Disposable.dispose} */
|
|
229
|
+
dispose(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
232
|
+
*
|
|
233
|
+
* @param meshes - The meshes to update.
|
|
234
|
+
*
|
|
235
|
+
* @returns {void}
|
|
236
|
+
*/
|
|
237
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
238
|
+
}
|
|
47
239
|
import { Component, Disposable, World, Event } from "../Types";
|
|
48
240
|
import { SimpleRaycaster } from "./src";
|
|
49
241
|
import { Components } from "../Components";
|
|
@@ -86,337 +278,219 @@ export declare class Raycasters extends Component implements Disposable {
|
|
|
86
278
|
/** {@link Disposable.dispose} */
|
|
87
279
|
dispose(): void;
|
|
88
280
|
}
|
|
89
|
-
import * as
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
|
|
93
|
-
* Types for boolean properties in IFC schema.
|
|
94
|
-
*/
|
|
95
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
96
|
-
/**
|
|
97
|
-
* Types for string properties in IFC schema.
|
|
98
|
-
*/
|
|
99
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
100
|
-
/**
|
|
101
|
-
* Types for numeric properties in IFC schema.
|
|
102
|
-
*/
|
|
103
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
104
|
-
/**
|
|
105
|
-
* 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.
|
|
106
|
-
*/
|
|
107
|
-
export interface ChangeMap {
|
|
108
|
-
[modelID: string]: Set<number>;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* 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.
|
|
112
|
-
*/
|
|
113
|
-
export interface AttributeListener {
|
|
114
|
-
[modelID: string]: {
|
|
115
|
-
[expressID: number]: {
|
|
116
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
}
|
|
281
|
+
import * as THREE from "three";
|
|
282
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
283
|
+
import { SimplePlane } from "./src";
|
|
284
|
+
import { Components } from "../Components";
|
|
120
285
|
/**
|
|
121
|
-
*
|
|
286
|
+
* 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).
|
|
287
|
+
*
|
|
288
|
+
* @param components - the instance of {@link Components} used.
|
|
289
|
+
* E.g. {@link SimplePlane}.
|
|
122
290
|
*/
|
|
123
|
-
export declare class
|
|
291
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
124
292
|
/**
|
|
125
293
|
* A unique identifier for the component.
|
|
126
294
|
* This UUID is used to register the component within the Components system.
|
|
127
295
|
*/
|
|
128
|
-
static readonly uuid: "
|
|
129
|
-
/**
|
|
130
|
-
readonly
|
|
296
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
297
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
298
|
+
readonly onBeforeDrag: Event<void>;
|
|
299
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
300
|
+
readonly onAfterDrag: Event<void>;
|
|
131
301
|
/**
|
|
132
|
-
* Event
|
|
302
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
133
303
|
*/
|
|
134
|
-
readonly
|
|
304
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
135
305
|
/**
|
|
136
|
-
*
|
|
306
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
137
307
|
*/
|
|
138
|
-
|
|
308
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
139
309
|
/**
|
|
140
|
-
* Event
|
|
310
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
141
311
|
*/
|
|
142
|
-
readonly
|
|
143
|
-
model: FragmentsGroup;
|
|
144
|
-
psetID: number;
|
|
145
|
-
elementID: number;
|
|
146
|
-
}>;
|
|
312
|
+
readonly onAfterCancel: Event<unknown>;
|
|
147
313
|
/**
|
|
148
|
-
* Event
|
|
314
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
149
315
|
*/
|
|
150
|
-
readonly
|
|
151
|
-
model: FragmentsGroup;
|
|
152
|
-
psetID: number;
|
|
153
|
-
propID: number;
|
|
154
|
-
}>;
|
|
316
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
155
317
|
/**
|
|
156
|
-
* Event
|
|
318
|
+
* Event that fires after a clipping plane has been created.
|
|
319
|
+
* @param plane - The newly created clipping plane.
|
|
157
320
|
*/
|
|
158
|
-
readonly
|
|
159
|
-
model: FragmentsGroup;
|
|
160
|
-
psetID: number;
|
|
161
|
-
}>;
|
|
321
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
162
322
|
/**
|
|
163
|
-
* Event
|
|
323
|
+
* Event that fires after a clipping plane has been deleted.
|
|
324
|
+
* @param plane - The deleted clipping plane.
|
|
164
325
|
*/
|
|
165
|
-
readonly
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}>;
|
|
326
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
327
|
+
/** {@link Disposable.onDisposed} */
|
|
328
|
+
readonly onDisposed: Event<string>;
|
|
169
329
|
/**
|
|
170
|
-
*
|
|
330
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
331
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
332
|
+
* clipping plane is created in its roof, which might have a slight
|
|
333
|
+
* slope for draining purposes.
|
|
171
334
|
*/
|
|
172
|
-
|
|
173
|
-
path: string;
|
|
174
|
-
absolute: boolean;
|
|
175
|
-
};
|
|
176
|
-
/** {@link Component.enabled} */
|
|
177
|
-
enabled: boolean;
|
|
335
|
+
orthogonalY: boolean;
|
|
178
336
|
/**
|
|
179
|
-
*
|
|
337
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
338
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
339
|
+
* has to be 'true' for this to apply.
|
|
180
340
|
*/
|
|
181
|
-
|
|
341
|
+
toleranceOrthogonalY: number;
|
|
182
342
|
/**
|
|
183
|
-
* The
|
|
343
|
+
* The type of clipping plane to be created.
|
|
344
|
+
* Default is {@link SimplePlane}.
|
|
184
345
|
*/
|
|
185
|
-
|
|
346
|
+
Type: new (...args: any) => SimplePlane;
|
|
186
347
|
/**
|
|
187
|
-
*
|
|
348
|
+
* A list of all the clipping planes created by this component.
|
|
188
349
|
*/
|
|
189
|
-
|
|
350
|
+
list: SimplePlane[];
|
|
351
|
+
/** The material used in all the clipping planes. */
|
|
352
|
+
private _material;
|
|
353
|
+
private _size;
|
|
354
|
+
private _enabled;
|
|
355
|
+
private _visible;
|
|
356
|
+
/** {@link Component.enabled} */
|
|
357
|
+
get enabled(): boolean;
|
|
358
|
+
/** {@link Component.enabled} */
|
|
359
|
+
set enabled(state: boolean);
|
|
360
|
+
/** {@link Hideable.visible } */
|
|
361
|
+
get visible(): boolean;
|
|
362
|
+
/** {@link Hideable.visible } */
|
|
363
|
+
set visible(state: boolean);
|
|
364
|
+
/** The material of the clipping plane representation. */
|
|
365
|
+
get material(): THREE.MeshBasicMaterial;
|
|
366
|
+
/** The material of the clipping plane representation. */
|
|
367
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
368
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
369
|
+
get size(): number;
|
|
370
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
371
|
+
set size(size: number);
|
|
190
372
|
constructor(components: Components);
|
|
191
373
|
/** {@link Disposable.dispose} */
|
|
192
374
|
dispose(): void;
|
|
375
|
+
/** {@link Createable.create} */
|
|
376
|
+
create(world: World): SimplePlane | null;
|
|
193
377
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
197
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
198
|
-
* @returns The IFC schema associated with the given model.
|
|
199
|
-
*/
|
|
200
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
201
|
-
/**
|
|
202
|
-
* Method to set properties data in the model.
|
|
203
|
-
*
|
|
204
|
-
* @param model - The FragmentsGroup model in which to set the properties.
|
|
205
|
-
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
206
|
-
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
207
|
-
* The rest of the properties will be set as the properties of the entity.
|
|
208
|
-
*
|
|
209
|
-
* @returns A promise that resolves when all the properties have been set.
|
|
378
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
379
|
+
* without the need of the mouse.
|
|
210
380
|
*
|
|
211
|
-
* @
|
|
381
|
+
* @param world - the world where this plane should be created.
|
|
382
|
+
* @param normal - the orientation of the clipping plane.
|
|
383
|
+
* @param point - the position of the clipping plane.
|
|
384
|
+
* navigation.
|
|
212
385
|
*/
|
|
213
|
-
|
|
386
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
214
387
|
/**
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
218
|
-
* @param name - The name of the Pset.
|
|
219
|
-
* @param description - (Optional) The description of the Pset.
|
|
220
|
-
*
|
|
221
|
-
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
388
|
+
* {@link Createable.delete}
|
|
222
389
|
*
|
|
223
|
-
* @
|
|
224
|
-
* @
|
|
390
|
+
* @param world - the world where the plane to delete is.
|
|
391
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
392
|
+
* found under the cursor will be deleted.
|
|
225
393
|
*/
|
|
226
|
-
|
|
227
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
228
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
229
|
-
}>;
|
|
394
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
230
395
|
/**
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
234
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
235
|
-
*
|
|
236
|
-
* @returns A promise that resolves when all the Psets have been removed.
|
|
396
|
+
* Deletes all the existing clipping planes.
|
|
237
397
|
*
|
|
238
|
-
* @
|
|
239
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
240
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
398
|
+
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
241
399
|
*/
|
|
242
|
-
|
|
400
|
+
deleteAll(types?: Set<string>): void;
|
|
401
|
+
private deletePlane;
|
|
402
|
+
private pickPlane;
|
|
403
|
+
private getAllPlaneMeshes;
|
|
404
|
+
private createPlaneFromIntersection;
|
|
405
|
+
private getWorldNormal;
|
|
406
|
+
private normalizePlaneDirectionY;
|
|
407
|
+
private newPlane;
|
|
408
|
+
private updateMaterialsAndPlanes;
|
|
409
|
+
private _onStartDragging;
|
|
410
|
+
private _onEndDragging;
|
|
411
|
+
}
|
|
412
|
+
import * as THREE from "three";
|
|
413
|
+
import { Components } from "../Components";
|
|
414
|
+
import { SimpleCamera } from "..";
|
|
415
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
416
|
+
/**
|
|
417
|
+
* 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).
|
|
418
|
+
*/
|
|
419
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
243
420
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
247
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
248
|
-
* @param name - The name of the property.
|
|
249
|
-
* @param value - The value of the property. Must be a string.
|
|
250
|
-
*
|
|
251
|
-
* @returns The newly created single-value property.
|
|
252
|
-
*
|
|
253
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
254
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
421
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
255
422
|
*/
|
|
256
|
-
|
|
423
|
+
readonly projection: ProjectionManager;
|
|
257
424
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
261
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
262
|
-
* @param name - The name of the property.
|
|
263
|
-
* @param value - The value of the property. Must be a number.
|
|
264
|
-
*
|
|
265
|
-
* @returns The newly created single-value property.
|
|
266
|
-
*
|
|
267
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
268
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
425
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
426
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
269
427
|
*/
|
|
270
|
-
|
|
428
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
271
429
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
275
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
276
|
-
* @param name - The name of the property.
|
|
277
|
-
* @param value - The value of the property. Must be a boolean.
|
|
278
|
-
*
|
|
279
|
-
* @returns The newly created single-value property.
|
|
280
|
-
*
|
|
281
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
282
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
430
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
431
|
+
* This camera is used when the projection mode is set to perspective.
|
|
283
432
|
*/
|
|
284
|
-
|
|
433
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
434
|
+
protected readonly _userInputButtons: any;
|
|
435
|
+
protected readonly _frustumSize = 50;
|
|
436
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
437
|
+
protected _mode: NavigationMode | null;
|
|
438
|
+
private previousSize;
|
|
285
439
|
/**
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* @param model - The FragmentsGroup model from which to remove the property.
|
|
289
|
-
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
290
|
-
* @param propID - The express ID of the property to be removed.
|
|
440
|
+
* Getter for the current navigation mode.
|
|
441
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
291
442
|
*
|
|
292
|
-
* @returns
|
|
443
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
293
444
|
*
|
|
294
|
-
* @throws
|
|
295
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
445
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
296
446
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
447
|
+
get mode(): NavigationMode;
|
|
448
|
+
constructor(components: Components);
|
|
449
|
+
/** {@link Disposable.dispose} */
|
|
450
|
+
dispose(): void;
|
|
299
451
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* @param model - The FragmentsGroup model in which to add the elements.
|
|
303
|
-
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
304
|
-
* @param elementID - The express IDs of the elements to be added.
|
|
305
|
-
*
|
|
306
|
-
* @returns A promise that resolves when all the elements have been added.
|
|
452
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
307
453
|
*
|
|
308
|
-
* @
|
|
309
|
-
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
310
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
454
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
311
455
|
*/
|
|
312
|
-
|
|
456
|
+
set(mode: NavModeID): void;
|
|
313
457
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
* @param model - The FragmentsGroup model from which to save the changes.
|
|
317
|
-
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
318
|
-
*
|
|
319
|
-
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
458
|
+
* Make the camera view fit all the specified meshes.
|
|
320
459
|
*
|
|
321
|
-
* @
|
|
460
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
461
|
+
* evaluate {@link Components.meshes}.
|
|
462
|
+
* @param offset the distance to the fit object
|
|
322
463
|
*/
|
|
323
|
-
|
|
464
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
324
465
|
/**
|
|
325
|
-
*
|
|
326
|
-
* The listener will trigger an event whenever the attribute's value changes.
|
|
327
|
-
*
|
|
328
|
-
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
329
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
330
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
331
|
-
*
|
|
332
|
-
* @returns The event that will be triggered when the attribute's value changes.
|
|
466
|
+
* Allows or prevents all user input.
|
|
333
467
|
*
|
|
334
|
-
* @
|
|
335
|
-
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
336
|
-
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
468
|
+
* @param active - whether to enable or disable user inputs.
|
|
337
469
|
*/
|
|
338
|
-
|
|
339
|
-
private
|
|
340
|
-
private
|
|
341
|
-
private
|
|
342
|
-
private
|
|
343
|
-
private newSingleProperty;
|
|
470
|
+
setUserInput(active: boolean): void;
|
|
471
|
+
private disableUserInput;
|
|
472
|
+
private enableUserInput;
|
|
473
|
+
private newOrthoCamera;
|
|
474
|
+
private setOrthoPerspCameraAspect;
|
|
344
475
|
}
|
|
345
|
-
import
|
|
476
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
477
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
346
478
|
import { Components } from "../Components";
|
|
347
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
348
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
349
479
|
/**
|
|
350
|
-
* A component that
|
|
480
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
351
481
|
*/
|
|
352
|
-
export declare class
|
|
482
|
+
export declare class Grids extends Component implements Disposable {
|
|
353
483
|
/**
|
|
354
484
|
* A unique identifier for the component.
|
|
355
485
|
* This UUID is used to register the component within the Components system.
|
|
356
486
|
*/
|
|
357
|
-
static readonly uuid: "
|
|
487
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
358
488
|
/**
|
|
359
|
-
*
|
|
489
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
360
490
|
*/
|
|
361
|
-
|
|
362
|
-
private _enabled;
|
|
491
|
+
list: Map<string, SimpleGrid>;
|
|
363
492
|
/**
|
|
364
|
-
*
|
|
365
|
-
*/
|
|
366
|
-
list: Map<string, MeshCullerRenderer>;
|
|
367
|
-
/** {@link Component.enabled} */
|
|
368
|
-
get enabled(): boolean;
|
|
369
|
-
/** {@link Component.enabled} */
|
|
370
|
-
set enabled(value: boolean);
|
|
371
|
-
constructor(components: Components);
|
|
372
|
-
/**
|
|
373
|
-
* Creates a new MeshCullerRenderer for the given world.
|
|
374
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
375
|
-
*
|
|
376
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
377
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
378
|
-
*
|
|
379
|
-
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
380
|
-
*/
|
|
381
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
382
|
-
/**
|
|
383
|
-
* Deletes the MeshCullerRenderer associated with the given world.
|
|
384
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
385
|
-
*
|
|
386
|
-
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
387
|
-
*
|
|
388
|
-
* @returns {void}
|
|
389
|
-
*/
|
|
390
|
-
delete(world: World): void;
|
|
391
|
-
/** {@link Disposable.dispose} */
|
|
392
|
-
dispose(): void;
|
|
393
|
-
/**
|
|
394
|
-
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
395
|
-
*
|
|
396
|
-
* @param meshes - The meshes to update.
|
|
397
|
-
*
|
|
398
|
-
* @returns {void}
|
|
399
|
-
*/
|
|
400
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
401
|
-
}
|
|
402
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
403
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
404
|
-
import { Components } from "../Components";
|
|
405
|
-
/**
|
|
406
|
-
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
407
|
-
*/
|
|
408
|
-
export declare class Grids extends Component implements Disposable {
|
|
409
|
-
/**
|
|
410
|
-
* A unique identifier for the component.
|
|
411
|
-
* This UUID is used to register the component within the Components system.
|
|
412
|
-
*/
|
|
413
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
414
|
-
/**
|
|
415
|
-
* A map of world UUIDs to their corresponding grid instances.
|
|
416
|
-
*/
|
|
417
|
-
list: Map<string, SimpleGrid>;
|
|
418
|
-
/**
|
|
419
|
-
* The default configuration for grid creation.
|
|
493
|
+
* The default configuration for grid creation.
|
|
420
494
|
*/
|
|
421
495
|
config: Required<GridConfig>;
|
|
422
496
|
/** {@link Disposable.onDisposed} */
|
|
@@ -448,81 +522,52 @@ export declare class Grids extends Component implements Disposable {
|
|
|
448
522
|
/** {@link Disposable.dispose} */
|
|
449
523
|
dispose(): void;
|
|
450
524
|
}
|
|
451
|
-
import {
|
|
525
|
+
import { MiniMap } from "./src";
|
|
526
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
527
|
+
import { Components } from "../Components";
|
|
452
528
|
/**
|
|
453
|
-
*
|
|
529
|
+
* 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).
|
|
454
530
|
*/
|
|
455
|
-
export declare class
|
|
531
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
456
532
|
/**
|
|
457
|
-
*
|
|
533
|
+
* A unique identifier for the component.
|
|
534
|
+
* This UUID is used to register the component within the Components system.
|
|
458
535
|
*/
|
|
459
|
-
static readonly
|
|
536
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
537
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
538
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
539
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
540
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
460
541
|
/** {@link Disposable.onDisposed} */
|
|
461
|
-
readonly onDisposed: Event<
|
|
462
|
-
/**
|
|
463
|
-
* The list of components created in this app.
|
|
464
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
465
|
-
*/
|
|
466
|
-
readonly list: Map<string, Component>;
|
|
467
|
-
/**
|
|
468
|
-
* If disabled, the animation loop will be stopped.
|
|
469
|
-
* Default value is false.
|
|
470
|
-
*/
|
|
542
|
+
readonly onDisposed: Event<unknown>;
|
|
543
|
+
/** {@link Component.enabled} */
|
|
471
544
|
enabled: boolean;
|
|
472
|
-
private _clock;
|
|
473
545
|
/**
|
|
474
|
-
*
|
|
475
|
-
* Throws an error if a component with the same UUID already exists.
|
|
476
|
-
*
|
|
477
|
-
* @param uuid - The unique identifier of the component.
|
|
478
|
-
* @param instance - The instance of the component to be added.
|
|
479
|
-
*
|
|
480
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
481
|
-
*
|
|
482
|
-
* @internal
|
|
546
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
483
547
|
*/
|
|
484
|
-
|
|
548
|
+
list: Map<string, MiniMap>;
|
|
549
|
+
constructor(components: Components);
|
|
485
550
|
/**
|
|
486
|
-
*
|
|
487
|
-
* If
|
|
488
|
-
*
|
|
489
|
-
* @template U - The type of the component to retrieve.
|
|
490
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
491
|
-
*
|
|
492
|
-
* @returns The instance of the requested component.
|
|
493
|
-
*
|
|
494
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
551
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
552
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
495
553
|
*
|
|
496
|
-
* @
|
|
554
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
555
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
556
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
497
557
|
*/
|
|
498
|
-
|
|
499
|
-
constructor();
|
|
558
|
+
create(world: World): MiniMap;
|
|
500
559
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* and calls the update method.
|
|
560
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
561
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
504
562
|
*
|
|
563
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
505
564
|
* @returns {void}
|
|
506
565
|
*/
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
510
|
-
* the library. A memory leak will be created if:
|
|
511
|
-
*
|
|
512
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
513
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
514
|
-
* Angular, Vue, etc).
|
|
515
|
-
*
|
|
516
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
517
|
-
* referenced by a reference type (object or array).
|
|
518
|
-
*
|
|
519
|
-
* You can learn more about how Three.js handles memory leaks
|
|
520
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
521
|
-
*
|
|
522
|
-
*/
|
|
566
|
+
delete(id: string): void;
|
|
567
|
+
/** {@link Disposable.dispose} */
|
|
523
568
|
dispose(): void;
|
|
524
|
-
|
|
525
|
-
|
|
569
|
+
/** {@link Updateable.update} */
|
|
570
|
+
update(): void;
|
|
526
571
|
}
|
|
527
572
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
528
573
|
import { Components } from "../Components";
|
|
@@ -591,308 +636,76 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
591
636
|
/** {@link Updateable.update} */
|
|
592
637
|
update(delta?: number): void | Promise<void>;
|
|
593
638
|
}
|
|
594
|
-
import
|
|
595
|
-
|
|
596
|
-
|
|
639
|
+
import * as THREE from "three";
|
|
640
|
+
export declare class MaterialsUtils {
|
|
641
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
642
|
+
}
|
|
643
|
+
export declare class UUID {
|
|
644
|
+
private static _pattern;
|
|
645
|
+
private static _lut;
|
|
646
|
+
static create(): string;
|
|
647
|
+
static validate(uuid: string): void;
|
|
648
|
+
}
|
|
649
|
+
import * as THREE from "three";
|
|
650
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
651
|
+
center: THREE.Vector3;
|
|
652
|
+
halfSizes: THREE.Vector3;
|
|
653
|
+
rotation: THREE.Matrix3;
|
|
654
|
+
transformation: THREE.Matrix4;
|
|
655
|
+
};
|
|
656
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
657
|
+
import * as THREE from "three";
|
|
658
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
597
659
|
/**
|
|
598
|
-
*
|
|
660
|
+
* Configuration interface for the VertexPicker component.
|
|
599
661
|
*/
|
|
600
|
-
export
|
|
601
|
-
/**
|
|
602
|
-
* A unique identifier for the component.
|
|
603
|
-
* This UUID is used to register the component within the Components system.
|
|
604
|
-
*/
|
|
605
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
606
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
607
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
608
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
609
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
610
|
-
/** {@link Disposable.onDisposed} */
|
|
611
|
-
readonly onDisposed: Event<unknown>;
|
|
612
|
-
/** {@link Component.enabled} */
|
|
613
|
-
enabled: boolean;
|
|
662
|
+
export interface VertexPickerConfig {
|
|
614
663
|
/**
|
|
615
|
-
*
|
|
664
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
616
665
|
*/
|
|
617
|
-
|
|
618
|
-
constructor(components: Components);
|
|
666
|
+
showOnlyVertex: boolean;
|
|
619
667
|
/**
|
|
620
|
-
*
|
|
621
|
-
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
622
|
-
*
|
|
623
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
624
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
625
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
668
|
+
* The maximum distance for snapping to a vertex.
|
|
626
669
|
*/
|
|
627
|
-
|
|
670
|
+
snapDistance: number;
|
|
628
671
|
/**
|
|
629
|
-
*
|
|
630
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
631
|
-
*
|
|
632
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
633
|
-
* @returns {void}
|
|
672
|
+
* The HTML element to use for previewing the picked vertex.
|
|
634
673
|
*/
|
|
635
|
-
|
|
636
|
-
/** {@link Disposable.dispose} */
|
|
637
|
-
dispose(): void;
|
|
638
|
-
/** {@link Updateable.update} */
|
|
639
|
-
update(): void;
|
|
674
|
+
previewElement: HTMLElement;
|
|
640
675
|
}
|
|
641
|
-
import * as THREE from "three";
|
|
642
|
-
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
643
|
-
import { SimplePlane } from "./src";
|
|
644
|
-
import { Components } from "../Components";
|
|
645
676
|
/**
|
|
646
|
-
* A
|
|
647
|
-
*
|
|
648
|
-
* @param components - the instance of {@link Components} used.
|
|
649
|
-
* E.g. {@link SimplePlane}.
|
|
677
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
650
678
|
*/
|
|
651
|
-
export declare class
|
|
652
|
-
/**
|
|
653
|
-
|
|
654
|
-
* This UUID is used to register the component within the Components system.
|
|
655
|
-
*/
|
|
656
|
-
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
657
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
658
|
-
readonly onBeforeDrag: Event<void>;
|
|
659
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
660
|
-
readonly onAfterDrag: Event<void>;
|
|
679
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
680
|
+
/** {@link Disposable.onDisposed} */
|
|
681
|
+
readonly onDisposed: Event<unknown>;
|
|
661
682
|
/**
|
|
662
|
-
*
|
|
683
|
+
* An event that is triggered when a vertex is found.
|
|
684
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
663
685
|
*/
|
|
664
|
-
readonly
|
|
686
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
665
687
|
/**
|
|
666
|
-
*
|
|
688
|
+
* An event that is triggered when a vertex is lost.
|
|
689
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
667
690
|
*/
|
|
668
|
-
readonly
|
|
691
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
669
692
|
/**
|
|
670
|
-
*
|
|
693
|
+
* An event that is triggered when the picker is enabled or disabled
|
|
671
694
|
*/
|
|
672
|
-
readonly
|
|
695
|
+
readonly onEnabled: Event<boolean>;
|
|
673
696
|
/**
|
|
674
|
-
*
|
|
697
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
675
698
|
*/
|
|
676
|
-
|
|
699
|
+
components: Components;
|
|
677
700
|
/**
|
|
678
|
-
*
|
|
679
|
-
*
|
|
701
|
+
* A reference to the working plane used for vertex picking.
|
|
702
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
703
|
+
* If this value is null, all vertices are considered valid.
|
|
680
704
|
*/
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
*/
|
|
686
|
-
readonly onAfterDelete: Event<SimplePlane>;
|
|
687
|
-
/** {@link Disposable.onDisposed} */
|
|
688
|
-
readonly onDisposed: Event<string>;
|
|
689
|
-
/**
|
|
690
|
-
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
691
|
-
* (up). This is desirable when clipping a building horizontally and a
|
|
692
|
-
* clipping plane is created in its roof, which might have a slight
|
|
693
|
-
* slope for draining purposes.
|
|
694
|
-
*/
|
|
695
|
-
orthogonalY: boolean;
|
|
696
|
-
/**
|
|
697
|
-
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
698
|
-
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
699
|
-
* has to be 'true' for this to apply.
|
|
700
|
-
*/
|
|
701
|
-
toleranceOrthogonalY: number;
|
|
702
|
-
/**
|
|
703
|
-
* The type of clipping plane to be created.
|
|
704
|
-
* Default is {@link SimplePlane}.
|
|
705
|
-
*/
|
|
706
|
-
Type: new (...args: any) => SimplePlane;
|
|
707
|
-
/**
|
|
708
|
-
* A list of all the clipping planes created by this component.
|
|
709
|
-
*/
|
|
710
|
-
list: SimplePlane[];
|
|
711
|
-
/** The material used in all the clipping planes. */
|
|
712
|
-
private _material;
|
|
713
|
-
private _size;
|
|
714
|
-
private _enabled;
|
|
715
|
-
private _visible;
|
|
716
|
-
/** {@link Component.enabled} */
|
|
717
|
-
get enabled(): boolean;
|
|
718
|
-
/** {@link Component.enabled} */
|
|
719
|
-
set enabled(state: boolean);
|
|
720
|
-
/** {@link Hideable.visible } */
|
|
721
|
-
get visible(): boolean;
|
|
722
|
-
/** {@link Hideable.visible } */
|
|
723
|
-
set visible(state: boolean);
|
|
724
|
-
/** The material of the clipping plane representation. */
|
|
725
|
-
get material(): THREE.MeshBasicMaterial;
|
|
726
|
-
/** The material of the clipping plane representation. */
|
|
727
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
728
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
729
|
-
get size(): number;
|
|
730
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
731
|
-
set size(size: number);
|
|
732
|
-
constructor(components: Components);
|
|
733
|
-
/** {@link Disposable.dispose} */
|
|
734
|
-
dispose(): void;
|
|
735
|
-
/** {@link Createable.create} */
|
|
736
|
-
create(world: World): SimplePlane | null;
|
|
737
|
-
/**
|
|
738
|
-
* Creates a plane in a certain place and with a certain orientation,
|
|
739
|
-
* without the need of the mouse.
|
|
740
|
-
*
|
|
741
|
-
* @param world - the world where this plane should be created.
|
|
742
|
-
* @param normal - the orientation of the clipping plane.
|
|
743
|
-
* @param point - the position of the clipping plane.
|
|
744
|
-
* navigation.
|
|
745
|
-
*/
|
|
746
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
747
|
-
/**
|
|
748
|
-
* {@link Createable.delete}
|
|
749
|
-
*
|
|
750
|
-
* @param world - the world where the plane to delete is.
|
|
751
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
752
|
-
* found under the cursor will be deleted.
|
|
753
|
-
*/
|
|
754
|
-
delete(world: World, plane?: SimplePlane): void;
|
|
755
|
-
/**
|
|
756
|
-
* Deletes all the existing clipping planes.
|
|
757
|
-
*
|
|
758
|
-
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
759
|
-
*/
|
|
760
|
-
deleteAll(types?: Set<string>): void;
|
|
761
|
-
private deletePlane;
|
|
762
|
-
private pickPlane;
|
|
763
|
-
private getAllPlaneMeshes;
|
|
764
|
-
private createPlaneFromIntersection;
|
|
765
|
-
private getWorldNormal;
|
|
766
|
-
private normalizePlaneDirectionY;
|
|
767
|
-
private newPlane;
|
|
768
|
-
private updateMaterialsAndPlanes;
|
|
769
|
-
private _onStartDragging;
|
|
770
|
-
private _onEndDragging;
|
|
771
|
-
}
|
|
772
|
-
import * as THREE from "three";
|
|
773
|
-
import { Components } from "../Components";
|
|
774
|
-
import { SimpleCamera } from "..";
|
|
775
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
776
|
-
/**
|
|
777
|
-
* 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).
|
|
778
|
-
*/
|
|
779
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
780
|
-
/**
|
|
781
|
-
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
782
|
-
*/
|
|
783
|
-
readonly projection: ProjectionManager;
|
|
784
|
-
/**
|
|
785
|
-
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
786
|
-
* This camera is used when the projection mode is set to orthographic.
|
|
787
|
-
*/
|
|
788
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
789
|
-
/**
|
|
790
|
-
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
791
|
-
* This camera is used when the projection mode is set to perspective.
|
|
792
|
-
*/
|
|
793
|
-
readonly threePersp: THREE.PerspectiveCamera;
|
|
794
|
-
protected readonly _userInputButtons: any;
|
|
795
|
-
protected readonly _frustumSize = 50;
|
|
796
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
797
|
-
protected _mode: NavigationMode | null;
|
|
798
|
-
private previousSize;
|
|
799
|
-
/**
|
|
800
|
-
* Getter for the current navigation mode.
|
|
801
|
-
* Throws an error if the mode is not found or the camera is not initialized.
|
|
802
|
-
*
|
|
803
|
-
* @returns {NavigationMode} The current navigation mode.
|
|
804
|
-
*
|
|
805
|
-
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
806
|
-
*/
|
|
807
|
-
get mode(): NavigationMode;
|
|
808
|
-
constructor(components: Components);
|
|
809
|
-
/** {@link Disposable.dispose} */
|
|
810
|
-
dispose(): void;
|
|
811
|
-
/**
|
|
812
|
-
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
813
|
-
*
|
|
814
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
815
|
-
*/
|
|
816
|
-
set(mode: NavModeID): void;
|
|
817
|
-
/**
|
|
818
|
-
* Make the camera view fit all the specified meshes.
|
|
819
|
-
*
|
|
820
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
821
|
-
* evaluate {@link Components.meshes}.
|
|
822
|
-
* @param offset the distance to the fit object
|
|
823
|
-
*/
|
|
824
|
-
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
825
|
-
/**
|
|
826
|
-
* Allows or prevents all user input.
|
|
827
|
-
*
|
|
828
|
-
* @param active - whether to enable or disable user inputs.
|
|
829
|
-
*/
|
|
830
|
-
setUserInput(active: boolean): void;
|
|
831
|
-
private disableUserInput;
|
|
832
|
-
private enableUserInput;
|
|
833
|
-
private newOrthoCamera;
|
|
834
|
-
private setOrthoPerspCameraAspect;
|
|
835
|
-
}
|
|
836
|
-
import * as THREE from "three";
|
|
837
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
838
|
-
center: THREE.Vector3;
|
|
839
|
-
halfSizes: THREE.Vector3;
|
|
840
|
-
rotation: THREE.Matrix3;
|
|
841
|
-
transformation: THREE.Matrix4;
|
|
842
|
-
};
|
|
843
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
844
|
-
import * as THREE from "three";
|
|
845
|
-
import { Component, Components, Disposable, Event, World } from "../core";
|
|
846
|
-
/**
|
|
847
|
-
* Configuration interface for the VertexPicker component.
|
|
848
|
-
*/
|
|
849
|
-
export interface VertexPickerConfig {
|
|
850
|
-
/**
|
|
851
|
-
* If true, only vertices will be picked, not the closest point on the face.
|
|
852
|
-
*/
|
|
853
|
-
showOnlyVertex: boolean;
|
|
854
|
-
/**
|
|
855
|
-
* The maximum distance for snapping to a vertex.
|
|
856
|
-
*/
|
|
857
|
-
snapDistance: number;
|
|
858
|
-
/**
|
|
859
|
-
* The HTML element to use for previewing the picked vertex.
|
|
860
|
-
*/
|
|
861
|
-
previewElement: HTMLElement;
|
|
862
|
-
}
|
|
863
|
-
/**
|
|
864
|
-
* A class that provides functionality for picking vertices in a 3D scene.
|
|
865
|
-
*/
|
|
866
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
867
|
-
/** {@link Disposable.onDisposed} */
|
|
868
|
-
readonly onDisposed: Event<unknown>;
|
|
869
|
-
/**
|
|
870
|
-
* An event that is triggered when a vertex is found.
|
|
871
|
-
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
872
|
-
*/
|
|
873
|
-
readonly onVertexFound: Event<THREE.Vector3>;
|
|
874
|
-
/**
|
|
875
|
-
* An event that is triggered when a vertex is lost.
|
|
876
|
-
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
877
|
-
*/
|
|
878
|
-
readonly onVertexLost: Event<THREE.Vector3>;
|
|
879
|
-
/**
|
|
880
|
-
* An event that is triggered when the picker is enabled or disabled
|
|
881
|
-
*/
|
|
882
|
-
readonly onEnabled: Event<boolean>;
|
|
883
|
-
/**
|
|
884
|
-
* A reference to the Components instance associated with this VertexPicker.
|
|
885
|
-
*/
|
|
886
|
-
components: Components;
|
|
887
|
-
/**
|
|
888
|
-
* A reference to the working plane used for vertex picking.
|
|
889
|
-
* This plane is used to determine which vertices are considered valid for picking.
|
|
890
|
-
* If this value is null, all vertices are considered valid.
|
|
891
|
-
*/
|
|
892
|
-
workingPlane: THREE.Plane | null;
|
|
893
|
-
private _pickedPoint;
|
|
894
|
-
private _config;
|
|
895
|
-
private _enabled;
|
|
705
|
+
workingPlane: THREE.Plane | null;
|
|
706
|
+
private _pickedPoint;
|
|
707
|
+
private _config;
|
|
708
|
+
private _enabled;
|
|
896
709
|
/**
|
|
897
710
|
* Sets the enabled state of the VertexPicker.
|
|
898
711
|
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
@@ -957,15 +770,30 @@ export declare class VertexPicker extends Component implements Disposable {
|
|
|
957
770
|
private getVertices;
|
|
958
771
|
private getVertex;
|
|
959
772
|
}
|
|
960
|
-
import * as
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
export
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
773
|
+
import * as WEBIFC from "web-ifc";
|
|
774
|
+
import * as FRAG from "@thatopen/fragments";
|
|
775
|
+
import { Component, Components } from "../../core";
|
|
776
|
+
/**
|
|
777
|
+
* 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).
|
|
778
|
+
*/
|
|
779
|
+
export declare class IfcJsonExporter extends Component {
|
|
780
|
+
/**
|
|
781
|
+
* A unique identifier for the component.
|
|
782
|
+
* This UUID is used to register the component within the Components system.
|
|
783
|
+
*/
|
|
784
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
785
|
+
/** {@link Component.enabled} */
|
|
786
|
+
enabled: boolean;
|
|
787
|
+
constructor(components: Components);
|
|
788
|
+
/**
|
|
789
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
790
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
791
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
792
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
793
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
794
|
+
* to make the location data available (e.g. absolute position of building).
|
|
795
|
+
*/
|
|
796
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
969
797
|
}
|
|
970
798
|
import * as WEBIFC from "web-ifc";
|
|
971
799
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -1131,222 +959,260 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1131
959
|
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
1132
960
|
}
|
|
1133
961
|
import * as WEBIFC from "web-ifc";
|
|
1134
|
-
import
|
|
1135
|
-
import { Component, Components } from "../../core";
|
|
962
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
963
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1136
964
|
/**
|
|
1137
|
-
*
|
|
965
|
+
* Types for boolean properties in IFC schema.
|
|
1138
966
|
*/
|
|
1139
|
-
export
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1154
|
-
* to make the location data available (e.g. absolute position of building).
|
|
1155
|
-
*/
|
|
1156
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
967
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
968
|
+
/**
|
|
969
|
+
* Types for string properties in IFC schema.
|
|
970
|
+
*/
|
|
971
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
972
|
+
/**
|
|
973
|
+
* Types for numeric properties in IFC schema.
|
|
974
|
+
*/
|
|
975
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
976
|
+
/**
|
|
977
|
+
* 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.
|
|
978
|
+
*/
|
|
979
|
+
export interface ChangeMap {
|
|
980
|
+
[modelID: string]: Set<number>;
|
|
1157
981
|
}
|
|
1158
|
-
import * as THREE from "three";
|
|
1159
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1160
|
-
import { Component, Components } from "../../core";
|
|
1161
982
|
/**
|
|
1162
|
-
*
|
|
983
|
+
* 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.
|
|
1163
984
|
*/
|
|
1164
|
-
export interface
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
* The two points that define the edge.
|
|
1171
|
-
*/
|
|
1172
|
-
points: THREE.Vector3[];
|
|
985
|
+
export interface AttributeListener {
|
|
986
|
+
[modelID: string]: {
|
|
987
|
+
[expressID: number]: {
|
|
988
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
1173
991
|
}
|
|
1174
992
|
/**
|
|
1175
|
-
*
|
|
993
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1176
994
|
*/
|
|
1177
|
-
export declare class
|
|
995
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1178
996
|
/**
|
|
1179
997
|
* A unique identifier for the component.
|
|
1180
998
|
* This UUID is used to register the component within the Components system.
|
|
1181
999
|
*/
|
|
1182
|
-
static uuid:
|
|
1183
|
-
/** {@link
|
|
1184
|
-
|
|
1185
|
-
constructor(components: Components);
|
|
1000
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1001
|
+
/** {@link Disposable.onDisposed} */
|
|
1002
|
+
readonly onDisposed: Event<string>;
|
|
1186
1003
|
/**
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
* @param point - The point from which to calculate the distance.
|
|
1190
|
-
* @param lineStart - The start point of the line segment.
|
|
1191
|
-
* @param lineEnd - The end point of the line segment.
|
|
1192
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1193
|
-
* @returns The distance from the point to the line segment.
|
|
1004
|
+
* Event triggered when a file is requested for export.
|
|
1194
1005
|
*/
|
|
1195
|
-
|
|
1006
|
+
readonly onRequestFile: Event<unknown>;
|
|
1196
1007
|
/**
|
|
1197
|
-
*
|
|
1198
|
-
* It also returns the edges of the found face and their indices.
|
|
1199
|
-
*
|
|
1200
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1201
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1202
|
-
* @param instance - The instance of the mesh (optional).
|
|
1203
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1008
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1204
1009
|
*/
|
|
1205
|
-
|
|
1206
|
-
edges: MeasureEdge[];
|
|
1207
|
-
indices: Set<number>;
|
|
1208
|
-
} | null;
|
|
1010
|
+
ifcToExport: ArrayBuffer | null;
|
|
1209
1011
|
/**
|
|
1210
|
-
*
|
|
1211
|
-
* It also applies instance transformation if provided.
|
|
1212
|
-
*
|
|
1213
|
-
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1214
|
-
* @param faceIndex - The index of the face within the mesh.
|
|
1215
|
-
* @param instance - The instance of the mesh (optional).
|
|
1216
|
-
* @returns An object containing the vertices and normal of the face.
|
|
1217
|
-
* @throws Will throw an error if the geometry is not indexed.
|
|
1012
|
+
* Event triggered when an element is added to a Pset.
|
|
1218
1013
|
*/
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
};
|
|
1014
|
+
readonly onElementToPset: Event<{
|
|
1015
|
+
model: FragmentsGroup;
|
|
1016
|
+
psetID: number;
|
|
1017
|
+
elementID: number;
|
|
1018
|
+
}>;
|
|
1225
1019
|
/**
|
|
1226
|
-
*
|
|
1227
|
-
* This is used to ensure numerical precision in edge detection.
|
|
1228
|
-
*
|
|
1229
|
-
* @param vector - The vector to round.
|
|
1230
|
-
* @returns The vector with rounded components.
|
|
1020
|
+
* Event triggered when a property is added to a Pset.
|
|
1231
1021
|
*/
|
|
1232
|
-
|
|
1022
|
+
readonly onPropToPset: Event<{
|
|
1023
|
+
model: FragmentsGroup;
|
|
1024
|
+
psetID: number;
|
|
1025
|
+
propID: number;
|
|
1026
|
+
}>;
|
|
1233
1027
|
/**
|
|
1234
|
-
*
|
|
1235
|
-
*
|
|
1236
|
-
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1237
|
-
* @returns The total volume of the fragments and the bounding sphere.
|
|
1238
|
-
*
|
|
1239
|
-
* @remarks
|
|
1240
|
-
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1241
|
-
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1242
|
-
*
|
|
1243
|
-
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1244
|
-
* @throws Will throw an error if the fragment manager is not available.
|
|
1028
|
+
* Event triggered when a Pset is removed.
|
|
1245
1029
|
*/
|
|
1246
|
-
|
|
1030
|
+
readonly onPsetRemoved: Event<{
|
|
1031
|
+
model: FragmentsGroup;
|
|
1032
|
+
psetID: number;
|
|
1033
|
+
}>;
|
|
1247
1034
|
/**
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1250
|
-
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1251
|
-
* @returns The total volume of the meshes and the bounding sphere.
|
|
1252
|
-
*
|
|
1253
|
-
* @remarks
|
|
1254
|
-
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1255
|
-
* and its bounding sphere.
|
|
1256
|
-
*
|
|
1035
|
+
* Event triggered when data in the model changes.
|
|
1257
1036
|
*/
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}
|
|
1263
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
1264
|
-
/**
|
|
1265
|
-
* 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).
|
|
1266
|
-
*/
|
|
1267
|
-
export declare class Exploder extends Component implements Disposable {
|
|
1037
|
+
readonly onDataChanged: Event<{
|
|
1038
|
+
model: FragmentsGroup;
|
|
1039
|
+
expressID: number;
|
|
1040
|
+
}>;
|
|
1268
1041
|
/**
|
|
1269
|
-
*
|
|
1270
|
-
* This UUID is used to register the component within the Components system.
|
|
1042
|
+
* Configuration for the WebAssembly module.
|
|
1271
1043
|
*/
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1044
|
+
wasm: {
|
|
1045
|
+
path: string;
|
|
1046
|
+
absolute: boolean;
|
|
1047
|
+
};
|
|
1275
1048
|
/** {@link Component.enabled} */
|
|
1276
1049
|
enabled: boolean;
|
|
1277
1050
|
/**
|
|
1278
|
-
*
|
|
1279
|
-
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1280
|
-
* Default value is 10.
|
|
1051
|
+
* Map of attribute listeners.
|
|
1281
1052
|
*/
|
|
1282
|
-
|
|
1053
|
+
attributeListeners: AttributeListener;
|
|
1283
1054
|
/**
|
|
1284
|
-
* The
|
|
1285
|
-
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1286
|
-
* Default value is "storeys".
|
|
1055
|
+
* The currently selected model.
|
|
1287
1056
|
*/
|
|
1288
|
-
|
|
1057
|
+
selectedModel?: FragmentsGroup;
|
|
1289
1058
|
/**
|
|
1290
|
-
*
|
|
1291
|
-
* This set is used to keep track of which items have been exploded.
|
|
1059
|
+
* Map of changed entities in the model.
|
|
1292
1060
|
*/
|
|
1293
|
-
|
|
1061
|
+
changeMap: ChangeMap;
|
|
1294
1062
|
constructor(components: Components);
|
|
1295
1063
|
/** {@link Disposable.dispose} */
|
|
1296
1064
|
dispose(): void;
|
|
1297
1065
|
/**
|
|
1298
|
-
*
|
|
1066
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1299
1067
|
*
|
|
1300
|
-
* @param
|
|
1068
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1069
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1070
|
+
* @returns The IFC schema associated with the given model.
|
|
1071
|
+
*/
|
|
1072
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1073
|
+
/**
|
|
1074
|
+
* Method to set properties data in the model.
|
|
1301
1075
|
*
|
|
1302
|
-
* @
|
|
1303
|
-
*
|
|
1304
|
-
*
|
|
1305
|
-
*
|
|
1076
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1077
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1078
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1079
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1306
1080
|
*
|
|
1307
|
-
*
|
|
1081
|
+
* @returns A promise that resolves when all the properties have been set.
|
|
1308
1082
|
*
|
|
1309
|
-
* @throws Will throw an error if
|
|
1310
|
-
*/
|
|
1311
|
-
set(active: boolean): void;
|
|
1312
|
-
}
|
|
1313
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1314
|
-
import { Components, Component } from "../../core";
|
|
1315
|
-
/**
|
|
1316
|
-
* 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).
|
|
1317
|
-
*/
|
|
1318
|
-
export declare class Hider extends Component {
|
|
1319
|
-
/**
|
|
1320
|
-
* A unique identifier for the component.
|
|
1321
|
-
* This UUID is used to register the component within the Components system.
|
|
1083
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1322
1084
|
*/
|
|
1323
|
-
|
|
1324
|
-
/** {@link Component.enabled} */
|
|
1325
|
-
enabled: boolean;
|
|
1326
|
-
constructor(components: Components);
|
|
1085
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1327
1086
|
/**
|
|
1328
|
-
*
|
|
1329
|
-
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1330
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
1087
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
1331
1088
|
*
|
|
1332
|
-
* @param
|
|
1333
|
-
* @param
|
|
1334
|
-
*
|
|
1089
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1090
|
+
* @param name - The name of the Pset.
|
|
1091
|
+
* @param description - (Optional) The description of the Pset.
|
|
1335
1092
|
*
|
|
1336
|
-
* @returns
|
|
1093
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1094
|
+
*
|
|
1095
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1096
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1337
1097
|
*/
|
|
1338
|
-
|
|
1098
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
1099
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
1100
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1101
|
+
}>;
|
|
1339
1102
|
/**
|
|
1340
|
-
*
|
|
1341
|
-
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1103
|
+
* Removes a Property Set (Pset) from the given model.
|
|
1342
1104
|
*
|
|
1343
|
-
* @param
|
|
1344
|
-
*
|
|
1105
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1106
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
1345
1107
|
*
|
|
1346
|
-
* @returns
|
|
1108
|
+
* @returns A promise that resolves when all the Psets have been removed.
|
|
1109
|
+
*
|
|
1110
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1111
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1112
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1347
1113
|
*/
|
|
1348
|
-
|
|
1349
|
-
|
|
1114
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1115
|
+
/**
|
|
1116
|
+
* Creates a new single-value property of type string in the given model.
|
|
1117
|
+
*
|
|
1118
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1119
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
1120
|
+
* @param name - The name of the property.
|
|
1121
|
+
* @param value - The value of the property. Must be a string.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns The newly created single-value property.
|
|
1124
|
+
*
|
|
1125
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1126
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1127
|
+
*/
|
|
1128
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
1131
|
+
*
|
|
1132
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1133
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
1134
|
+
* @param name - The name of the property.
|
|
1135
|
+
* @param value - The value of the property. Must be a number.
|
|
1136
|
+
*
|
|
1137
|
+
* @returns The newly created single-value property.
|
|
1138
|
+
*
|
|
1139
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1140
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1141
|
+
*/
|
|
1142
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1143
|
+
/**
|
|
1144
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
1145
|
+
*
|
|
1146
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1147
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
1148
|
+
* @param name - The name of the property.
|
|
1149
|
+
* @param value - The value of the property. Must be a boolean.
|
|
1150
|
+
*
|
|
1151
|
+
* @returns The newly created single-value property.
|
|
1152
|
+
*
|
|
1153
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1154
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1155
|
+
*/
|
|
1156
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
1159
|
+
*
|
|
1160
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1161
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1162
|
+
* @param propID - The express ID of the property to be removed.
|
|
1163
|
+
*
|
|
1164
|
+
* @returns A promise that resolves when the property has been removed.
|
|
1165
|
+
*
|
|
1166
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1167
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1168
|
+
*/
|
|
1169
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1170
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): Promise<void>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
1173
|
+
*
|
|
1174
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1175
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1176
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns A promise that resolves when all the elements have been added.
|
|
1179
|
+
*
|
|
1180
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1181
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1182
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1183
|
+
*/
|
|
1184
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
1185
|
+
/**
|
|
1186
|
+
* Saves the changes made to the model to a new IFC file.
|
|
1187
|
+
*
|
|
1188
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
1189
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1190
|
+
*
|
|
1191
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1192
|
+
*
|
|
1193
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
1194
|
+
*/
|
|
1195
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
1198
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
1199
|
+
*
|
|
1200
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1201
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1202
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1203
|
+
*
|
|
1204
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
1205
|
+
*
|
|
1206
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
1207
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1208
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1209
|
+
*/
|
|
1210
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
1211
|
+
private increaseMaxID;
|
|
1212
|
+
private newGUID;
|
|
1213
|
+
private getOwnerHistory;
|
|
1214
|
+
private registerChange;
|
|
1215
|
+
private newSingleProperty;
|
|
1350
1216
|
}
|
|
1351
1217
|
import * as THREE from "three";
|
|
1352
1218
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -1558,6 +1424,111 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
1558
1424
|
}
|
|
1559
1425
|
import * as THREE from "three";
|
|
1560
1426
|
import * as FRAGS from "@thatopen/fragments";
|
|
1427
|
+
import { Component, Components } from "../../core";
|
|
1428
|
+
/**
|
|
1429
|
+
* Represents an edge measurement result.
|
|
1430
|
+
*/
|
|
1431
|
+
export interface MeasureEdge {
|
|
1432
|
+
/**
|
|
1433
|
+
* The distance between the two points of the edge.
|
|
1434
|
+
*/
|
|
1435
|
+
distance: number;
|
|
1436
|
+
/**
|
|
1437
|
+
* The two points that define the edge.
|
|
1438
|
+
*/
|
|
1439
|
+
points: THREE.Vector3[];
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* 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).
|
|
1443
|
+
*/
|
|
1444
|
+
export declare class MeasurementUtils extends Component {
|
|
1445
|
+
/**
|
|
1446
|
+
* A unique identifier for the component.
|
|
1447
|
+
* This UUID is used to register the component within the Components system.
|
|
1448
|
+
*/
|
|
1449
|
+
static uuid: string;
|
|
1450
|
+
/** {@link Component.enabled} */
|
|
1451
|
+
enabled: boolean;
|
|
1452
|
+
constructor(components: Components);
|
|
1453
|
+
/**
|
|
1454
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
1455
|
+
*
|
|
1456
|
+
* @param point - The point from which to calculate the distance.
|
|
1457
|
+
* @param lineStart - The start point of the line segment.
|
|
1458
|
+
* @param lineEnd - The end point of the line segment.
|
|
1459
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
1460
|
+
* @returns The distance from the point to the line segment.
|
|
1461
|
+
*/
|
|
1462
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1463
|
+
/**
|
|
1464
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
1465
|
+
* It also returns the edges of the found face and their indices.
|
|
1466
|
+
*
|
|
1467
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1468
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
1469
|
+
* @param instance - The instance of the mesh (optional).
|
|
1470
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
1471
|
+
*/
|
|
1472
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1473
|
+
edges: MeasureEdge[];
|
|
1474
|
+
indices: Set<number>;
|
|
1475
|
+
} | null;
|
|
1476
|
+
/**
|
|
1477
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
1478
|
+
* It also applies instance transformation if provided.
|
|
1479
|
+
*
|
|
1480
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
1481
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
1482
|
+
* @param instance - The instance of the mesh (optional).
|
|
1483
|
+
* @returns An object containing the vertices and normal of the face.
|
|
1484
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
1485
|
+
*/
|
|
1486
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1487
|
+
p1: THREE.Vector3;
|
|
1488
|
+
p2: THREE.Vector3;
|
|
1489
|
+
p3: THREE.Vector3;
|
|
1490
|
+
faceNormal: THREE.Vector3;
|
|
1491
|
+
};
|
|
1492
|
+
/**
|
|
1493
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
1494
|
+
* This is used to ensure numerical precision in edge detection.
|
|
1495
|
+
*
|
|
1496
|
+
* @param vector - The vector to round.
|
|
1497
|
+
* @returns The vector with rounded components.
|
|
1498
|
+
*/
|
|
1499
|
+
round(vector: THREE.Vector3): void;
|
|
1500
|
+
/**
|
|
1501
|
+
* Calculates the volume of a set of fragments.
|
|
1502
|
+
*
|
|
1503
|
+
* @param frags - A map of fragment IDs to their corresponding item IDs.
|
|
1504
|
+
* @returns The total volume of the fragments and the bounding sphere.
|
|
1505
|
+
*
|
|
1506
|
+
* @remarks
|
|
1507
|
+
* This method creates a set of instanced meshes from the given fragments and item IDs.
|
|
1508
|
+
* It then calculates the volume of each mesh and returns the total volume and its bounding sphere.
|
|
1509
|
+
*
|
|
1510
|
+
* @throws Will throw an error if the geometry of the meshes is not indexed.
|
|
1511
|
+
* @throws Will throw an error if the fragment manager is not available.
|
|
1512
|
+
*/
|
|
1513
|
+
getVolumeFromFragments(frags: FRAGS.FragmentIdMap): number;
|
|
1514
|
+
/**
|
|
1515
|
+
* Calculates the total volume of a set of meshes.
|
|
1516
|
+
*
|
|
1517
|
+
* @param meshes - An array of meshes or instanced meshes to calculate the volume from.
|
|
1518
|
+
* @returns The total volume of the meshes and the bounding sphere.
|
|
1519
|
+
*
|
|
1520
|
+
* @remarks
|
|
1521
|
+
* This method calculates the volume of each mesh in the provided array and returns the total volume
|
|
1522
|
+
* and its bounding sphere.
|
|
1523
|
+
*
|
|
1524
|
+
*/
|
|
1525
|
+
getVolumeFromMeshes(meshes: THREE.InstancedMesh[] | THREE.Mesh[]): number;
|
|
1526
|
+
private getFaceData;
|
|
1527
|
+
private getVolumeOfMesh;
|
|
1528
|
+
private getSignedVolumeOfTriangle;
|
|
1529
|
+
}
|
|
1530
|
+
import * as THREE from "three";
|
|
1531
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1561
1532
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
1562
1533
|
/**
|
|
1563
1534
|
* Interface representing a classification system. The classification is organized by system and class name, and each class contains a map of fragment IDs with extra information.
|
|
@@ -1730,52 +1701,140 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
1730
1701
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
1731
1702
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
|
|
1732
1703
|
}
|
|
1733
|
-
import
|
|
1734
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1735
|
-
import { IfcFragmentSettings } from "./src";
|
|
1736
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
1704
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1737
1705
|
/**
|
|
1738
|
-
* The
|
|
1706
|
+
* 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).
|
|
1739
1707
|
*/
|
|
1740
|
-
export declare class
|
|
1708
|
+
export declare class Exploder extends Component implements Disposable {
|
|
1741
1709
|
/**
|
|
1742
1710
|
* A unique identifier for the component.
|
|
1743
1711
|
* This UUID is used to register the component within the Components system.
|
|
1744
1712
|
*/
|
|
1745
|
-
static readonly uuid: "
|
|
1713
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1746
1714
|
/** {@link Disposable.onDisposed} */
|
|
1747
|
-
readonly onDisposed: Event<
|
|
1748
|
-
/**
|
|
1749
|
-
|
|
1750
|
-
*/
|
|
1751
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
1715
|
+
readonly onDisposed: Event<unknown>;
|
|
1716
|
+
/** {@link Component.enabled} */
|
|
1717
|
+
enabled: boolean;
|
|
1752
1718
|
/**
|
|
1753
|
-
*
|
|
1719
|
+
* The height of the explosion animation.
|
|
1720
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1721
|
+
* Default value is 10.
|
|
1754
1722
|
*/
|
|
1755
|
-
|
|
1723
|
+
height: number;
|
|
1756
1724
|
/**
|
|
1757
|
-
* The
|
|
1758
|
-
*
|
|
1725
|
+
* The group name used for the explosion animation.
|
|
1726
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1727
|
+
* Default value is "storeys".
|
|
1759
1728
|
*/
|
|
1760
|
-
|
|
1729
|
+
groupName: string;
|
|
1761
1730
|
/**
|
|
1762
|
-
*
|
|
1731
|
+
* A set of strings representing the exploded items.
|
|
1732
|
+
* This set is used to keep track of which items have been exploded.
|
|
1763
1733
|
*/
|
|
1764
|
-
|
|
1765
|
-
/** {@link Component.enabled} */
|
|
1766
|
-
enabled: boolean;
|
|
1767
|
-
private _material;
|
|
1768
|
-
private _spatialTree;
|
|
1769
|
-
private _metaData;
|
|
1770
|
-
private _fragmentInstances;
|
|
1771
|
-
private _civil;
|
|
1772
|
-
private _visitedFragments;
|
|
1773
|
-
private _materialT;
|
|
1734
|
+
list: Set<string>;
|
|
1774
1735
|
constructor(components: Components);
|
|
1775
1736
|
/** {@link Disposable.dispose} */
|
|
1776
1737
|
dispose(): void;
|
|
1777
1738
|
/**
|
|
1778
|
-
* Sets
|
|
1739
|
+
* Sets the explosion state of the fragments.
|
|
1740
|
+
*
|
|
1741
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1742
|
+
*
|
|
1743
|
+
* @remarks
|
|
1744
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1745
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1746
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1747
|
+
*
|
|
1748
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1749
|
+
*
|
|
1750
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1751
|
+
*/
|
|
1752
|
+
set(active: boolean): void;
|
|
1753
|
+
}
|
|
1754
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1755
|
+
import { Components, Component } from "../../core";
|
|
1756
|
+
/**
|
|
1757
|
+
* 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).
|
|
1758
|
+
*/
|
|
1759
|
+
export declare class Hider extends Component {
|
|
1760
|
+
/**
|
|
1761
|
+
* A unique identifier for the component.
|
|
1762
|
+
* This UUID is used to register the component within the Components system.
|
|
1763
|
+
*/
|
|
1764
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1765
|
+
/** {@link Component.enabled} */
|
|
1766
|
+
enabled: boolean;
|
|
1767
|
+
constructor(components: Components);
|
|
1768
|
+
/**
|
|
1769
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1770
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1771
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1772
|
+
*
|
|
1773
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1774
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1775
|
+
* If not provided, all fragments will be affected.
|
|
1776
|
+
*
|
|
1777
|
+
* @returns {void}
|
|
1778
|
+
*/
|
|
1779
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1780
|
+
/**
|
|
1781
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1782
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1783
|
+
*
|
|
1784
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1785
|
+
* If not provided, all fragments will be isolated.
|
|
1786
|
+
*
|
|
1787
|
+
* @returns {void}
|
|
1788
|
+
*/
|
|
1789
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1790
|
+
private updateCulledVisibility;
|
|
1791
|
+
}
|
|
1792
|
+
import * as WEBIFC from "web-ifc";
|
|
1793
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1794
|
+
import { IfcFragmentSettings } from "./src";
|
|
1795
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1796
|
+
/**
|
|
1797
|
+
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1798
|
+
*/
|
|
1799
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1800
|
+
/**
|
|
1801
|
+
* A unique identifier for the component.
|
|
1802
|
+
* This UUID is used to register the component within the Components system.
|
|
1803
|
+
*/
|
|
1804
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1805
|
+
/** {@link Disposable.onDisposed} */
|
|
1806
|
+
readonly onDisposed: Event<string>;
|
|
1807
|
+
/**
|
|
1808
|
+
* An event triggered when the IFC file starts loading.
|
|
1809
|
+
*/
|
|
1810
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1811
|
+
/**
|
|
1812
|
+
* An event triggered when the setup process is completed.
|
|
1813
|
+
*/
|
|
1814
|
+
readonly onSetup: Event<void>;
|
|
1815
|
+
/**
|
|
1816
|
+
* The settings for the IfcLoader.
|
|
1817
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1818
|
+
*/
|
|
1819
|
+
settings: IfcFragmentSettings;
|
|
1820
|
+
/**
|
|
1821
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1822
|
+
*/
|
|
1823
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1824
|
+
/** {@link Component.enabled} */
|
|
1825
|
+
enabled: boolean;
|
|
1826
|
+
private _material;
|
|
1827
|
+
private _spatialTree;
|
|
1828
|
+
private _metaData;
|
|
1829
|
+
private _fragmentInstances;
|
|
1830
|
+
private _civil;
|
|
1831
|
+
private _visitedFragments;
|
|
1832
|
+
private _materialT;
|
|
1833
|
+
constructor(components: Components);
|
|
1834
|
+
/** {@link Disposable.dispose} */
|
|
1835
|
+
dispose(): void;
|
|
1836
|
+
/**
|
|
1837
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1779
1838
|
*
|
|
1780
1839
|
* @param config - Optional configuration settings for the IfcLoader.
|
|
1781
1840
|
* If not provided, the existing settings will be used.
|
|
@@ -1982,13 +2041,6 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
1982
2041
|
clone(model: FRAGS.FragmentsGroup, items?: FRAGS.FragmentIdMap): FragmentsGroup;
|
|
1983
2042
|
}
|
|
1984
2043
|
import * as WEBIFC from "web-ifc";
|
|
1985
|
-
export interface IfcItemsCategories {
|
|
1986
|
-
[itemID: number]: number;
|
|
1987
|
-
}
|
|
1988
|
-
export declare class IfcCategories {
|
|
1989
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
1990
|
-
}
|
|
1991
|
-
import * as WEBIFC from "web-ifc";
|
|
1992
2044
|
import { Components, Disposable, Event, Component } from "../../core";
|
|
1993
2045
|
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1994
2046
|
/**
|
|
@@ -2086,48 +2138,6 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
2086
2138
|
private streamAssets;
|
|
2087
2139
|
private streamGeometries;
|
|
2088
2140
|
}
|
|
2089
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2090
|
-
export declare class IfcPropertiesUtils {
|
|
2091
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2092
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2093
|
-
[attribute: string]: any;
|
|
2094
|
-
} | null>;
|
|
2095
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2096
|
-
[relatingID: number]: number[];
|
|
2097
|
-
}>;
|
|
2098
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2099
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2100
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2101
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2102
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2103
|
-
key: string | null;
|
|
2104
|
-
name: string | null;
|
|
2105
|
-
}>;
|
|
2106
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2107
|
-
key: string | null;
|
|
2108
|
-
value: number | null;
|
|
2109
|
-
}>;
|
|
2110
|
-
static isRel(expressID: number): boolean;
|
|
2111
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2112
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2113
|
-
}
|
|
2114
|
-
/**
|
|
2115
|
-
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2116
|
-
*
|
|
2117
|
-
* @remarks
|
|
2118
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2119
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2120
|
-
*
|
|
2121
|
-
*/
|
|
2122
|
-
export declare const IfcElements: {
|
|
2123
|
-
[key: number]: string;
|
|
2124
|
-
};
|
|
2125
|
-
/**
|
|
2126
|
-
* 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.
|
|
2127
|
-
*/
|
|
2128
|
-
export declare const IfcCategoryMap: {
|
|
2129
|
-
[key: number]: string;
|
|
2130
|
-
};
|
|
2131
2141
|
import * as WEBIFC from "web-ifc";
|
|
2132
2142
|
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
2133
2143
|
import { PropertiesStreamingSettings } from "./src";
|
|
@@ -2193,10 +2203,59 @@ export declare class IfcPropertiesTiler extends Component implements Disposable
|
|
|
2193
2203
|
private streamAllProperties;
|
|
2194
2204
|
private cleanUp;
|
|
2195
2205
|
}
|
|
2206
|
+
import * as WEBIFC from "web-ifc";
|
|
2207
|
+
export interface IfcItemsCategories {
|
|
2208
|
+
[itemID: number]: number;
|
|
2209
|
+
}
|
|
2210
|
+
export declare class IfcCategories {
|
|
2211
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2212
|
+
}
|
|
2196
2213
|
/**
|
|
2197
2214
|
* A Set of unique numbers representing different types of IFC geometries.
|
|
2198
2215
|
*/
|
|
2199
2216
|
export declare const GeometryTypes: Set<number>;
|
|
2217
|
+
/**
|
|
2218
|
+
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2219
|
+
*
|
|
2220
|
+
* @remarks
|
|
2221
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2222
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2223
|
+
*
|
|
2224
|
+
*/
|
|
2225
|
+
export declare const IfcElements: {
|
|
2226
|
+
[key: number]: string;
|
|
2227
|
+
};
|
|
2228
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2229
|
+
export declare class IfcPropertiesUtils {
|
|
2230
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
2231
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
2232
|
+
[attribute: string]: any;
|
|
2233
|
+
} | null>;
|
|
2234
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
2235
|
+
[relatingID: number]: number[];
|
|
2236
|
+
}>;
|
|
2237
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2238
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
2239
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
2240
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
2241
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
2242
|
+
key: string | null;
|
|
2243
|
+
name: string | null;
|
|
2244
|
+
}>;
|
|
2245
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
2246
|
+
key: string | null;
|
|
2247
|
+
value: number | null;
|
|
2248
|
+
}>;
|
|
2249
|
+
static isRel(expressID: number): boolean;
|
|
2250
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
2251
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* 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.
|
|
2255
|
+
*/
|
|
2256
|
+
export declare const IfcCategoryMap: {
|
|
2257
|
+
[key: number]: string;
|
|
2258
|
+
};
|
|
2200
2259
|
import * as THREE from "three";
|
|
2201
2260
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
2202
2261
|
/**
|
|
@@ -2286,123 +2345,262 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2286
2345
|
resize(size?: THREE.Vector2): void;
|
|
2287
2346
|
private updatePlanes;
|
|
2288
2347
|
}
|
|
2289
|
-
import
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
}
|
|
2294
|
-
import * as
|
|
2295
|
-
import {
|
|
2296
|
-
|
|
2297
|
-
itemsByFloor: IfcItemsCategories;
|
|
2298
|
-
private _units;
|
|
2299
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2300
|
-
cleanUp(): void;
|
|
2301
|
-
}
|
|
2348
|
+
import { InverseAttribute } from "./types";
|
|
2349
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711, {
|
|
2350
|
+
forRelating: InverseAttribute;
|
|
2351
|
+
forRelated: InverseAttribute;
|
|
2352
|
+
}>;
|
|
2353
|
+
import * as THREE from "three";
|
|
2354
|
+
import { Event, World } from "../../Types";
|
|
2355
|
+
import { Components } from "../../Components";
|
|
2302
2356
|
/**
|
|
2303
|
-
*
|
|
2357
|
+
* A base renderer to determine visibility on screen.
|
|
2304
2358
|
*/
|
|
2305
|
-
export declare class
|
|
2359
|
+
export declare class DistanceRenderer {
|
|
2360
|
+
/** {@link Disposable.onDisposed} */
|
|
2361
|
+
readonly onDisposed: Event<string>;
|
|
2306
2362
|
/**
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2363
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2364
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2365
|
+
* just before but not anymore.
|
|
2309
2366
|
*/
|
|
2310
|
-
|
|
2311
|
-
(): void;
|
|
2312
|
-
} : {
|
|
2313
|
-
(data: T): void;
|
|
2314
|
-
}): void;
|
|
2367
|
+
readonly onDistanceComputed: Event<number>;
|
|
2315
2368
|
/**
|
|
2316
|
-
*
|
|
2317
|
-
* @param handler - the callback to be removed from this event.
|
|
2369
|
+
* Objects that won't be taken into account in the distance check.
|
|
2318
2370
|
*/
|
|
2319
|
-
|
|
2320
|
-
(): void;
|
|
2321
|
-
} : {
|
|
2322
|
-
(data: T): void;
|
|
2323
|
-
}): void;
|
|
2324
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2325
|
-
trigger: (data?: T) => void;
|
|
2326
|
-
/** Gets rid of all the suscribed events. */
|
|
2327
|
-
reset(): void;
|
|
2328
|
-
private handlers;
|
|
2329
|
-
}
|
|
2330
|
-
import * as WEBIFC from "web-ifc";
|
|
2331
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
2332
|
-
export declare class IfcFragmentSettings {
|
|
2333
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
2334
|
-
includeProperties: boolean;
|
|
2371
|
+
excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
2335
2372
|
/**
|
|
2336
|
-
*
|
|
2337
|
-
* like IFCSPACE.
|
|
2373
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2338
2374
|
*/
|
|
2339
|
-
|
|
2340
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
2341
|
-
coordinate: boolean;
|
|
2342
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2343
|
-
wasm: {
|
|
2344
|
-
path: string;
|
|
2345
|
-
absolute: boolean;
|
|
2346
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2347
|
-
};
|
|
2348
|
-
/** List of categories that won't be converted to fragments. */
|
|
2349
|
-
excludedCategories: Set<number>;
|
|
2350
|
-
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
2351
|
-
includedCategories: Set<number>;
|
|
2352
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
2353
|
-
saveLocations: boolean;
|
|
2354
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2355
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
2375
|
+
enabled: boolean;
|
|
2356
2376
|
/**
|
|
2357
|
-
*
|
|
2358
|
-
*
|
|
2359
|
-
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2360
|
-
* Default value is true.
|
|
2377
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2378
|
+
* for debugging purposes.
|
|
2361
2379
|
*/
|
|
2362
|
-
|
|
2380
|
+
renderDebugFrame: boolean;
|
|
2381
|
+
/** The components instance to which this renderer belongs. */
|
|
2382
|
+
components: Components;
|
|
2363
2383
|
/**
|
|
2364
|
-
*
|
|
2365
|
-
|
|
2366
|
-
|
|
2384
|
+
* The scene where the distance is computed.
|
|
2385
|
+
*/
|
|
2386
|
+
scene: THREE.Scene;
|
|
2387
|
+
/**
|
|
2388
|
+
* The camera used to compute the distance.
|
|
2389
|
+
*/
|
|
2390
|
+
camera: THREE.OrthographicCamera;
|
|
2391
|
+
/**
|
|
2392
|
+
* The material used to compute the distance.
|
|
2393
|
+
*/
|
|
2394
|
+
depthMaterial: THREE.ShaderMaterial;
|
|
2395
|
+
/** The world instance to which this renderer belongs. */
|
|
2396
|
+
readonly world: World;
|
|
2397
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2398
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2399
|
+
protected readonly worker: Worker;
|
|
2400
|
+
private _width;
|
|
2401
|
+
private _height;
|
|
2402
|
+
private readonly _postQuad;
|
|
2403
|
+
private readonly tempRT;
|
|
2404
|
+
private readonly resultRT;
|
|
2405
|
+
private readonly bufferSize;
|
|
2406
|
+
private readonly _buffer;
|
|
2407
|
+
protected _isWorkerBusy: boolean;
|
|
2408
|
+
constructor(components: Components, world: World);
|
|
2409
|
+
/** {@link Disposable.dispose} */
|
|
2410
|
+
dispose(): void;
|
|
2411
|
+
/**
|
|
2412
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2413
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2414
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2415
|
+
* not true.
|
|
2416
|
+
*/
|
|
2417
|
+
compute: () => Promise<void>;
|
|
2418
|
+
private handleWorkerMessage;
|
|
2419
|
+
}
|
|
2420
|
+
import * as THREE from "three";
|
|
2421
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2422
|
+
import { Components } from "../../Components";
|
|
2423
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2424
|
+
/**
|
|
2425
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2426
|
+
*/
|
|
2427
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2428
|
+
/**
|
|
2429
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2430
|
+
* Contains two sets: seen and unseen.
|
|
2431
|
+
*/
|
|
2432
|
+
readonly onViewUpdated: Event<{
|
|
2433
|
+
seen: Set<THREE.Mesh>;
|
|
2434
|
+
unseen: Set<THREE.Mesh>;
|
|
2435
|
+
}>;
|
|
2436
|
+
/**
|
|
2437
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2438
|
+
* Default value is 100.
|
|
2439
|
+
*/
|
|
2440
|
+
threshold: number;
|
|
2441
|
+
/**
|
|
2442
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2443
|
+
* Used to keep track of color-coded meshes.
|
|
2444
|
+
*/
|
|
2445
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2446
|
+
/**
|
|
2447
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2448
|
+
* Used to prevent concurrent processing.
|
|
2449
|
+
*/
|
|
2450
|
+
isProcessing: boolean;
|
|
2451
|
+
private _colorCodeMeshMap;
|
|
2452
|
+
private _meshIDColorCodeMap;
|
|
2453
|
+
private _currentVisibleMeshes;
|
|
2454
|
+
private _recentlyHiddenMeshes;
|
|
2455
|
+
private _intervalID;
|
|
2456
|
+
private readonly _transparentMat;
|
|
2457
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2458
|
+
/** {@link Disposable.dispose} */
|
|
2459
|
+
dispose(): void;
|
|
2460
|
+
/**
|
|
2461
|
+
* 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.
|
|
2462
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2463
|
+
* @returns {void}
|
|
2464
|
+
*/
|
|
2465
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2466
|
+
/**
|
|
2467
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2468
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2469
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2470
|
+
* @returns {void}
|
|
2471
|
+
*/
|
|
2472
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2473
|
+
/**
|
|
2474
|
+
* Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
2367
2475
|
*
|
|
2368
|
-
* @param
|
|
2369
|
-
*
|
|
2476
|
+
* @param meshes - The meshes to update.
|
|
2477
|
+
*
|
|
2478
|
+
* @returns {void}
|
|
2370
2479
|
*/
|
|
2371
|
-
|
|
2480
|
+
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
2481
|
+
private handleWorkerMessage;
|
|
2482
|
+
private getAvailableMaterial;
|
|
2483
|
+
}
|
|
2484
|
+
import * as THREE from "three";
|
|
2485
|
+
import { Components } from "../../Components";
|
|
2486
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
2487
|
+
/**
|
|
2488
|
+
* Settings to configure the CullerRenderer.
|
|
2489
|
+
*/
|
|
2490
|
+
export interface CullerRendererSettings {
|
|
2491
|
+
/**
|
|
2492
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
2493
|
+
* Default value is 1000.
|
|
2494
|
+
*/
|
|
2495
|
+
updateInterval?: number;
|
|
2496
|
+
/**
|
|
2497
|
+
* Width of the render target used for visibility checks.
|
|
2498
|
+
* Default value is 512.
|
|
2499
|
+
*/
|
|
2500
|
+
width?: number;
|
|
2501
|
+
/**
|
|
2502
|
+
* Height of the render target used for visibility checks.
|
|
2503
|
+
* Default value is 512.
|
|
2504
|
+
*/
|
|
2505
|
+
height?: number;
|
|
2506
|
+
/**
|
|
2507
|
+
* Whether the visibility check should be performed automatically.
|
|
2508
|
+
* Default value is true.
|
|
2509
|
+
*/
|
|
2510
|
+
autoUpdate?: boolean;
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* A base renderer to determine visibility on screen.
|
|
2514
|
+
*/
|
|
2515
|
+
export declare class CullerRenderer {
|
|
2516
|
+
/** {@link Disposable.onDisposed} */
|
|
2517
|
+
readonly onDisposed: Event<string>;
|
|
2518
|
+
/**
|
|
2519
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2520
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2521
|
+
* just before but not anymore.
|
|
2522
|
+
*/
|
|
2523
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2524
|
+
/**
|
|
2525
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2526
|
+
*/
|
|
2527
|
+
enabled: boolean;
|
|
2528
|
+
/**
|
|
2529
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2530
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2531
|
+
*/
|
|
2532
|
+
needsUpdate: boolean;
|
|
2533
|
+
/**
|
|
2534
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2535
|
+
* for debugging purposes.
|
|
2536
|
+
*/
|
|
2537
|
+
renderDebugFrame: boolean;
|
|
2538
|
+
/** The components instance to which this renderer belongs. */
|
|
2539
|
+
components: Components;
|
|
2540
|
+
/** The world instance to which this renderer belongs. */
|
|
2541
|
+
readonly world: World;
|
|
2542
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2543
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2544
|
+
protected autoUpdate: boolean;
|
|
2545
|
+
protected updateInterval: number;
|
|
2546
|
+
protected readonly worker: Worker;
|
|
2547
|
+
protected readonly scene: THREE.Scene;
|
|
2548
|
+
private _width;
|
|
2549
|
+
private _height;
|
|
2550
|
+
private _availableColor;
|
|
2551
|
+
private readonly renderTarget;
|
|
2552
|
+
private readonly bufferSize;
|
|
2553
|
+
private readonly _buffer;
|
|
2554
|
+
protected _isWorkerBusy: boolean;
|
|
2555
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2556
|
+
/** {@link Disposable.dispose} */
|
|
2557
|
+
dispose(): void;
|
|
2558
|
+
/**
|
|
2559
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2560
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2561
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2562
|
+
* not true.
|
|
2563
|
+
*/
|
|
2564
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
2565
|
+
protected getAvailableColor(): {
|
|
2566
|
+
r: number;
|
|
2567
|
+
g: number;
|
|
2568
|
+
b: number;
|
|
2569
|
+
code: string;
|
|
2570
|
+
};
|
|
2571
|
+
protected increaseColor(): void;
|
|
2572
|
+
protected decreaseColor(): void;
|
|
2573
|
+
private applySettings;
|
|
2372
2574
|
}
|
|
2575
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2373
2576
|
/**
|
|
2374
2577
|
* 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.
|
|
2375
2578
|
*/
|
|
2376
|
-
export declare class
|
|
2579
|
+
export declare class Event<T> {
|
|
2377
2580
|
/**
|
|
2378
2581
|
* Add a callback to this event instance.
|
|
2379
2582
|
* @param handler - the callback to be added to this event.
|
|
2380
2583
|
*/
|
|
2381
2584
|
add(handler: T extends void ? {
|
|
2382
|
-
():
|
|
2585
|
+
(): void;
|
|
2383
2586
|
} : {
|
|
2384
|
-
(data: T):
|
|
2587
|
+
(data: T): void;
|
|
2385
2588
|
}): void;
|
|
2386
2589
|
/**
|
|
2387
2590
|
* Removes a callback from this event instance.
|
|
2388
2591
|
* @param handler - the callback to be removed from this event.
|
|
2389
2592
|
*/
|
|
2390
2593
|
remove(handler: T extends void ? {
|
|
2391
|
-
():
|
|
2594
|
+
(): void;
|
|
2392
2595
|
} : {
|
|
2393
|
-
(data: T):
|
|
2596
|
+
(data: T): void;
|
|
2394
2597
|
}): void;
|
|
2395
2598
|
/** Triggers all the callbacks assigned to this event. */
|
|
2396
|
-
trigger: (data?: T) =>
|
|
2599
|
+
trigger: (data?: T) => void;
|
|
2397
2600
|
/** Gets rid of all the suscribed events. */
|
|
2398
2601
|
reset(): void;
|
|
2399
2602
|
private handlers;
|
|
2400
2603
|
}
|
|
2401
|
-
import { InverseAttribute } from "./types";
|
|
2402
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856, {
|
|
2403
|
-
forRelating: InverseAttribute;
|
|
2404
|
-
forRelated: InverseAttribute;
|
|
2405
|
-
}>;
|
|
2406
2604
|
import * as THREE from "three";
|
|
2407
2605
|
import CameraControls from "camera-controls";
|
|
2408
2606
|
import { Event } from "./event";
|
|
@@ -2524,52 +2722,131 @@ export declare abstract class Component extends Base {
|
|
|
2524
2722
|
*/
|
|
2525
2723
|
abstract enabled: boolean;
|
|
2526
2724
|
}
|
|
2527
|
-
import
|
|
2528
|
-
import
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
*/
|
|
2532
|
-
export declare abstract class Base {
|
|
2533
|
-
components: Components;
|
|
2534
|
-
constructor(components: Components);
|
|
2535
|
-
/** Whether is component is {@link Disposable}. */
|
|
2536
|
-
isDisposeable: () => this is Disposable;
|
|
2537
|
-
/** Whether is component is {@link Resizeable}. */
|
|
2538
|
-
isResizeable: () => this is Resizeable;
|
|
2539
|
-
/** Whether is component is {@link Updateable}. */
|
|
2540
|
-
isUpdateable: () => this is Updateable;
|
|
2541
|
-
/** Whether is component is {@link Hideable}. */
|
|
2542
|
-
isHideable: () => this is Hideable;
|
|
2543
|
-
/** Whether is component is {@link Configurable}. */
|
|
2544
|
-
isConfigurable: () => this is Configurable<any>;
|
|
2725
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2726
|
+
import * as WEBIFC from "web-ifc";
|
|
2727
|
+
export declare class SpatialIdsFinder {
|
|
2728
|
+
static get(model: FRAGS.FragmentsGroup, webIfc: WEBIFC.IfcAPI): void;
|
|
2545
2729
|
}
|
|
2546
|
-
import * as
|
|
2547
|
-
import
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2730
|
+
import * as WEBIFC from "web-ifc";
|
|
2731
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
2732
|
+
export declare class SpatialStructure {
|
|
2733
|
+
itemsByFloor: IfcItemsCategories;
|
|
2734
|
+
private _units;
|
|
2735
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2736
|
+
cleanUp(): void;
|
|
2737
|
+
}
|
|
2738
|
+
import * as WEBIFC from "web-ifc";
|
|
2739
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2740
|
+
export declare class IfcFragmentSettings {
|
|
2741
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2742
|
+
includeProperties: boolean;
|
|
2558
2743
|
/**
|
|
2559
|
-
*
|
|
2744
|
+
* Generate the geometry for categories that are not included by default,
|
|
2745
|
+
* like IFCSPACE.
|
|
2560
2746
|
*/
|
|
2561
|
-
|
|
2747
|
+
optionalCategories: number[];
|
|
2748
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2749
|
+
coordinate: boolean;
|
|
2750
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2751
|
+
wasm: {
|
|
2752
|
+
path: string;
|
|
2753
|
+
absolute: boolean;
|
|
2754
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2755
|
+
};
|
|
2756
|
+
/** List of categories that won't be converted to fragments. */
|
|
2757
|
+
excludedCategories: Set<number>;
|
|
2758
|
+
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
2759
|
+
includedCategories: Set<number>;
|
|
2760
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2761
|
+
saveLocations: boolean;
|
|
2762
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2763
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2562
2764
|
/**
|
|
2563
|
-
*
|
|
2564
|
-
*
|
|
2765
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2766
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2767
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2768
|
+
* Default value is true.
|
|
2565
2769
|
*/
|
|
2566
|
-
|
|
2770
|
+
autoSetWasm: boolean;
|
|
2567
2771
|
/**
|
|
2568
|
-
*
|
|
2772
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2773
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2774
|
+
* If set to null, the default file location handler will be used.
|
|
2569
2775
|
*
|
|
2570
|
-
* @
|
|
2776
|
+
* @param url - The URL of the file to locate.
|
|
2777
|
+
* @returns The absolute path of the file.
|
|
2571
2778
|
*/
|
|
2572
|
-
|
|
2779
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* 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.
|
|
2783
|
+
*/
|
|
2784
|
+
export declare class AsyncEvent<T> {
|
|
2785
|
+
/**
|
|
2786
|
+
* Add a callback to this event instance.
|
|
2787
|
+
* @param handler - the callback to be added to this event.
|
|
2788
|
+
*/
|
|
2789
|
+
add(handler: T extends void ? {
|
|
2790
|
+
(): Promise<void>;
|
|
2791
|
+
} : {
|
|
2792
|
+
(data: T): Promise<void>;
|
|
2793
|
+
}): void;
|
|
2794
|
+
/**
|
|
2795
|
+
* Removes a callback from this event instance.
|
|
2796
|
+
* @param handler - the callback to be removed from this event.
|
|
2797
|
+
*/
|
|
2798
|
+
remove(handler: T extends void ? {
|
|
2799
|
+
(): Promise<void>;
|
|
2800
|
+
} : {
|
|
2801
|
+
(data: T): Promise<void>;
|
|
2802
|
+
}): void;
|
|
2803
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2804
|
+
trigger: (data?: T) => Promise<void>;
|
|
2805
|
+
/** Gets rid of all the suscribed events. */
|
|
2806
|
+
reset(): void;
|
|
2807
|
+
private handlers;
|
|
2808
|
+
}
|
|
2809
|
+
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2810
|
+
import { Components } from "../../Components";
|
|
2811
|
+
/**
|
|
2812
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
2813
|
+
*/
|
|
2814
|
+
export declare abstract class Base {
|
|
2815
|
+
components: Components;
|
|
2816
|
+
constructor(components: Components);
|
|
2817
|
+
/** Whether is component is {@link Disposable}. */
|
|
2818
|
+
isDisposeable: () => this is Disposable;
|
|
2819
|
+
/** Whether is component is {@link Resizeable}. */
|
|
2820
|
+
isResizeable: () => this is Resizeable;
|
|
2821
|
+
/** Whether is component is {@link Updateable}. */
|
|
2822
|
+
isUpdateable: () => this is Updateable;
|
|
2823
|
+
/** Whether is component is {@link Hideable}. */
|
|
2824
|
+
isHideable: () => this is Hideable;
|
|
2825
|
+
/** Whether is component is {@link Configurable}. */
|
|
2826
|
+
isConfigurable: () => this is Configurable<any>;
|
|
2827
|
+
}
|
|
2828
|
+
import { Base } from "./base";
|
|
2829
|
+
import { World } from "./world";
|
|
2830
|
+
import { Event } from "./event";
|
|
2831
|
+
import { Components } from "../../Components";
|
|
2832
|
+
/**
|
|
2833
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2834
|
+
*/
|
|
2835
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
2836
|
+
readonly worlds: Map<string, World>;
|
|
2837
|
+
/**
|
|
2838
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2839
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2840
|
+
*/
|
|
2841
|
+
readonly onWorldChanged: Event<{
|
|
2842
|
+
world: World;
|
|
2843
|
+
action: "added" | "removed";
|
|
2844
|
+
}>;
|
|
2845
|
+
/**
|
|
2846
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2847
|
+
*/
|
|
2848
|
+
currentWorld: World | null;
|
|
2849
|
+
protected constructor(components: Components);
|
|
2573
2850
|
}
|
|
2574
2851
|
import * as THREE from "three";
|
|
2575
2852
|
import { Vector2 } from "three";
|
|
@@ -2636,29 +2913,6 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2636
2913
|
*/
|
|
2637
2914
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2638
2915
|
}
|
|
2639
|
-
import { Base } from "./base";
|
|
2640
|
-
import { World } from "./world";
|
|
2641
|
-
import { Event } from "./event";
|
|
2642
|
-
import { Components } from "../../Components";
|
|
2643
|
-
/**
|
|
2644
|
-
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2645
|
-
*/
|
|
2646
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
2647
|
-
readonly worlds: Map<string, World>;
|
|
2648
|
-
/**
|
|
2649
|
-
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2650
|
-
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2651
|
-
*/
|
|
2652
|
-
readonly onWorldChanged: Event<{
|
|
2653
|
-
world: World;
|
|
2654
|
-
action: "added" | "removed";
|
|
2655
|
-
}>;
|
|
2656
|
-
/**
|
|
2657
|
-
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2658
|
-
*/
|
|
2659
|
-
currentWorld: World | null;
|
|
2660
|
-
protected constructor(components: Components);
|
|
2661
|
-
}
|
|
2662
2916
|
import * as THREE from "three";
|
|
2663
2917
|
import { Disposable } from "./interfaces";
|
|
2664
2918
|
import { Event } from "./event";
|
|
@@ -2675,10 +2929,92 @@ export declare abstract class BaseScene extends BaseWorldItem implements Disposa
|
|
|
2675
2929
|
* It should be implemented by subclasses.
|
|
2676
2930
|
*/
|
|
2677
2931
|
abstract three: THREE.Object3D;
|
|
2932
|
+
/** The set of directional lights managed by this scene component. */
|
|
2933
|
+
directionalLights: Map<string, THREE.DirectionalLight>;
|
|
2934
|
+
/** The set of ambient lights managed by this scene component. */
|
|
2935
|
+
ambientLights: Map<string, THREE.AmbientLight>;
|
|
2678
2936
|
protected constructor(components: Components);
|
|
2679
2937
|
/** {@link Disposable.dispose} */
|
|
2680
2938
|
dispose(): void;
|
|
2681
2939
|
}
|
|
2940
|
+
import { NavigationMode } from "./types";
|
|
2941
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2942
|
+
/**
|
|
2943
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
2944
|
+
*/
|
|
2945
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
2946
|
+
private camera;
|
|
2947
|
+
/** {@link NavigationMode.enabled} */
|
|
2948
|
+
enabled: boolean;
|
|
2949
|
+
/** {@link NavigationMode.id} */
|
|
2950
|
+
readonly id = "FirstPerson";
|
|
2951
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
2952
|
+
/** {@link NavigationMode.set} */
|
|
2953
|
+
set(active: boolean): void;
|
|
2954
|
+
private setupFirstPersonCamera;
|
|
2955
|
+
}
|
|
2956
|
+
import * as THREE from "three";
|
|
2957
|
+
import CameraControls from "camera-controls";
|
|
2958
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2959
|
+
import { CameraControllable } from "./interfaces";
|
|
2960
|
+
/**
|
|
2961
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2962
|
+
*/
|
|
2963
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2964
|
+
/**
|
|
2965
|
+
* Whether the camera is enabled or not.
|
|
2966
|
+
*/
|
|
2967
|
+
abstract enabled: boolean;
|
|
2968
|
+
/**
|
|
2969
|
+
* The Three.js camera instance.
|
|
2970
|
+
*/
|
|
2971
|
+
abstract three: THREE.Camera;
|
|
2972
|
+
/**
|
|
2973
|
+
* Optional CameraControls instance for controlling the camera.
|
|
2974
|
+
* This property is only available if the camera is controllable.
|
|
2975
|
+
*/
|
|
2976
|
+
abstract controls?: CameraControls;
|
|
2977
|
+
/**
|
|
2978
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
2979
|
+
*
|
|
2980
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
2981
|
+
*/
|
|
2982
|
+
hasCameraControls: () => this is CameraControllable;
|
|
2983
|
+
}
|
|
2984
|
+
import * as THREE from "three";
|
|
2985
|
+
import { BaseScene } from "./base-scene";
|
|
2986
|
+
import { BaseCamera } from "./base-camera";
|
|
2987
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2988
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2989
|
+
/**
|
|
2990
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2991
|
+
*/
|
|
2992
|
+
export interface World extends Disposable, Updateable {
|
|
2993
|
+
/**
|
|
2994
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2995
|
+
*/
|
|
2996
|
+
meshes: Set<THREE.Mesh>;
|
|
2997
|
+
/**
|
|
2998
|
+
* The base scene of the world.
|
|
2999
|
+
*/
|
|
3000
|
+
scene: BaseScene;
|
|
3001
|
+
/**
|
|
3002
|
+
* The base camera of the world.
|
|
3003
|
+
*/
|
|
3004
|
+
camera: BaseCamera;
|
|
3005
|
+
/**
|
|
3006
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
3007
|
+
*/
|
|
3008
|
+
renderer: BaseRenderer | null;
|
|
3009
|
+
/**
|
|
3010
|
+
* A unique identifier for the world.
|
|
3011
|
+
*/
|
|
3012
|
+
uuid: string;
|
|
3013
|
+
/**
|
|
3014
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
3015
|
+
*/
|
|
3016
|
+
isDisposing: boolean;
|
|
3017
|
+
}
|
|
2682
3018
|
import { Event } from "./event";
|
|
2683
3019
|
/**
|
|
2684
3020
|
* A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations.
|
|
@@ -2788,39 +3124,112 @@ export declare class DataSet<T> extends Set<T> {
|
|
|
2788
3124
|
*/
|
|
2789
3125
|
dispose(): void;
|
|
2790
3126
|
}
|
|
2791
|
-
import
|
|
2792
|
-
import {
|
|
2793
|
-
import { BaseCamera } from "./base-camera";
|
|
2794
|
-
import { BaseRenderer } from "./base-renderer";
|
|
2795
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
3127
|
+
import { NavigationMode } from "./types";
|
|
3128
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
2796
3129
|
/**
|
|
2797
|
-
*
|
|
3130
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
2798
3131
|
*/
|
|
2799
|
-
export
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
3132
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3133
|
+
camera: OrthoPerspectiveCamera;
|
|
3134
|
+
/** {@link NavigationMode.enabled} */
|
|
3135
|
+
enabled: boolean;
|
|
3136
|
+
/** {@link NavigationMode.id} */
|
|
3137
|
+
readonly id = "Orbit";
|
|
3138
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3139
|
+
/** {@link NavigationMode.set} */
|
|
3140
|
+
set(active: boolean): void;
|
|
3141
|
+
private activateOrbitControls;
|
|
3142
|
+
}
|
|
3143
|
+
import { NavigationMode } from "./types";
|
|
3144
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3145
|
+
/**
|
|
3146
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3147
|
+
*/
|
|
3148
|
+
export declare class PlanMode implements NavigationMode {
|
|
3149
|
+
private camera;
|
|
3150
|
+
/** {@link NavigationMode.enabled} */
|
|
3151
|
+
enabled: boolean;
|
|
3152
|
+
/** {@link NavigationMode.id} */
|
|
3153
|
+
readonly id = "Plan";
|
|
3154
|
+
private mouseAction1?;
|
|
3155
|
+
private mouseAction2?;
|
|
3156
|
+
private mouseInitialized;
|
|
3157
|
+
private readonly defaultAzimuthSpeed;
|
|
3158
|
+
private readonly defaultPolarSpeed;
|
|
3159
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3160
|
+
/** {@link NavigationMode.set} */
|
|
3161
|
+
set(active: boolean): void;
|
|
3162
|
+
}
|
|
3163
|
+
import * as THREE from "three";
|
|
3164
|
+
import { CameraProjection } from "./types";
|
|
3165
|
+
import { Event } from "../../Types";
|
|
3166
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3167
|
+
/**
|
|
3168
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3169
|
+
*/
|
|
3170
|
+
export declare class ProjectionManager {
|
|
3171
|
+
/**
|
|
3172
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
2822
3173
|
*/
|
|
2823
|
-
|
|
3174
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3175
|
+
/**
|
|
3176
|
+
* Current projection mode of the camera.
|
|
3177
|
+
* Default is "Perspective".
|
|
3178
|
+
*/
|
|
3179
|
+
current: CameraProjection;
|
|
3180
|
+
/**
|
|
3181
|
+
* The camera controlled by this ProjectionManager.
|
|
3182
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3183
|
+
*/
|
|
3184
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3185
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3186
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3187
|
+
private _component;
|
|
3188
|
+
private _previousDistance;
|
|
3189
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3190
|
+
/**
|
|
3191
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3192
|
+
*
|
|
3193
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3194
|
+
* it will have no effect.
|
|
3195
|
+
*/
|
|
3196
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3197
|
+
/**
|
|
3198
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3199
|
+
* and vice versa.
|
|
3200
|
+
*/
|
|
3201
|
+
toggle(): Promise<void>;
|
|
3202
|
+
private setOrthoCamera;
|
|
3203
|
+
private getPerspectiveDims;
|
|
3204
|
+
private setupOrthoCamera;
|
|
3205
|
+
private getDistance;
|
|
3206
|
+
private setPerspectiveCamera;
|
|
3207
|
+
}
|
|
3208
|
+
/**
|
|
3209
|
+
* The projection system of the camera.
|
|
3210
|
+
*/
|
|
3211
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3212
|
+
/**
|
|
3213
|
+
* The extensible list of supported navigation modes.
|
|
3214
|
+
*/
|
|
3215
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3216
|
+
/**
|
|
3217
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3218
|
+
*/
|
|
3219
|
+
export interface NavigationMode {
|
|
3220
|
+
/** The unique ID of this navigation mode. */
|
|
3221
|
+
id: NavModeID;
|
|
3222
|
+
/**
|
|
3223
|
+
* Enable or disable this navigation mode.
|
|
3224
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3225
|
+
* must be disabled.
|
|
3226
|
+
*
|
|
3227
|
+
* @param active - whether to enable or disable this mode.
|
|
3228
|
+
* @param options - any additional data required to enable or disable it.
|
|
3229
|
+
* */
|
|
3230
|
+
set: (active: boolean, options?: any) => void;
|
|
3231
|
+
/** Whether this navigation mode is active or not. */
|
|
3232
|
+
enabled: boolean;
|
|
2824
3233
|
}
|
|
2825
3234
|
import * as THREE from "three";
|
|
2826
3235
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -2902,316 +3311,44 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2902
3311
|
dispose(disposeResources?: boolean): void;
|
|
2903
3312
|
}
|
|
2904
3313
|
import * as THREE from "three";
|
|
2905
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2906
|
-
import { Components } from "../../Components";
|
|
2907
|
-
/**
|
|
2908
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2909
|
-
*/
|
|
2910
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
2911
|
-
/**
|
|
2912
|
-
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2913
|
-
* Default is 'true'.
|
|
2914
|
-
*/
|
|
2915
|
-
enabled: boolean;
|
|
2916
|
-
/**
|
|
2917
|
-
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
2918
|
-
*/
|
|
2919
|
-
container: HTMLElement;
|
|
2920
|
-
/**
|
|
2921
|
-
* The THREE.js WebGLRenderer instance.
|
|
2922
|
-
*/
|
|
2923
|
-
three: THREE.WebGLRenderer;
|
|
2924
|
-
protected _canvas: HTMLCanvasElement;
|
|
2925
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2926
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
2927
|
-
protected onContainerUpdated: Event<unknown>;
|
|
2928
|
-
private _resizing;
|
|
2929
|
-
/**
|
|
2930
|
-
* Constructor for the SimpleRenderer class.
|
|
2931
|
-
*
|
|
2932
|
-
* @param components - The components instance.
|
|
2933
|
-
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2934
|
-
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
2935
|
-
*/
|
|
2936
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2937
|
-
/** {@link Updateable.update} */
|
|
2938
|
-
update(): void;
|
|
2939
|
-
/** {@link Disposable.dispose} */
|
|
2940
|
-
dispose(): void;
|
|
2941
|
-
/** {@link Resizeable.getSize}. */
|
|
2942
|
-
getSize(): THREE.Vector2;
|
|
2943
|
-
/** {@link Resizeable.resize} */
|
|
2944
|
-
resize: (size?: THREE.Vector2) => void;
|
|
2945
|
-
/**
|
|
2946
|
-
* Sets up and manages the event listeners for the renderer.
|
|
2947
|
-
*
|
|
2948
|
-
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2949
|
-
*
|
|
2950
|
-
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
2951
|
-
*/
|
|
2952
|
-
setupEvents(active: boolean): void;
|
|
2953
|
-
private resizeEvent;
|
|
2954
|
-
private setupRenderer;
|
|
2955
|
-
private onContextLost;
|
|
2956
|
-
private onContextBack;
|
|
2957
|
-
}
|
|
2958
|
-
import * as THREE from "three";
|
|
2959
|
-
import CameraControls from "camera-controls";
|
|
2960
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
2961
|
-
import { Components } from "../../Components";
|
|
2962
|
-
/**
|
|
2963
|
-
* 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.
|
|
2964
|
-
*/
|
|
2965
|
-
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
2966
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
2967
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
2968
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
2969
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
2970
|
-
/**
|
|
2971
|
-
* Event that is triggered when the aspect of the camera has been updated.
|
|
2972
|
-
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
2973
|
-
*/
|
|
2974
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
2975
|
-
/** {@link Disposable.onDisposed} */
|
|
2976
|
-
readonly onDisposed: Event<string>;
|
|
2977
|
-
/**
|
|
2978
|
-
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
2979
|
-
* This camera is used for rendering the scene.
|
|
2980
|
-
*/
|
|
2981
|
-
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
2982
|
-
private _allControls;
|
|
2983
|
-
/**
|
|
2984
|
-
* The object that controls the camera. An instance of
|
|
2985
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
2986
|
-
* Transforming the camera directly will have no effect: you need to use this
|
|
2987
|
-
* object to move, rotate, look at objects, etc.
|
|
2988
|
-
*/
|
|
2989
|
-
get controls(): CameraControls;
|
|
2990
|
-
/**
|
|
2991
|
-
* Getter for the enabled state of the camera controls.
|
|
2992
|
-
* If the current world is null, it returns false.
|
|
2993
|
-
* Otherwise, it returns the enabled state of the camera controls.
|
|
2994
|
-
*
|
|
2995
|
-
* @returns {boolean} The enabled state of the camera controls.
|
|
2996
|
-
*/
|
|
2997
|
-
get enabled(): boolean;
|
|
2998
|
-
/**
|
|
2999
|
-
* Setter for the enabled state of the camera controls.
|
|
3000
|
-
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3001
|
-
*
|
|
3002
|
-
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3003
|
-
*/
|
|
3004
|
-
set enabled(enabled: boolean);
|
|
3005
|
-
constructor(components: Components);
|
|
3006
|
-
/** {@link Disposable.dispose} */
|
|
3007
|
-
dispose(): void;
|
|
3008
|
-
/** {@link Updateable.update} */
|
|
3009
|
-
update(_delta: number): void;
|
|
3010
|
-
/**
|
|
3011
|
-
* Updates the aspect of the camera to match the size of the
|
|
3012
|
-
* {@link Components.renderer}.
|
|
3013
|
-
*/
|
|
3014
|
-
updateAspect: () => void;
|
|
3015
|
-
private setupCamera;
|
|
3016
|
-
private newCameraControls;
|
|
3017
|
-
private setupEvents;
|
|
3018
|
-
private static getSubsetOfThree;
|
|
3019
|
-
}
|
|
3020
|
-
import * as THREE from "three";
|
|
3021
3314
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3022
3315
|
import { Components } from "../../Components";
|
|
3023
3316
|
/**
|
|
3024
3317
|
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3025
3318
|
*/
|
|
3026
3319
|
export interface SimpleSceneConfig {
|
|
3027
|
-
directionalLight: {
|
|
3028
|
-
color: THREE.Color;
|
|
3029
|
-
intensity: number;
|
|
3030
|
-
position: THREE.Vector3;
|
|
3031
|
-
};
|
|
3032
|
-
ambientLight: {
|
|
3033
|
-
color: THREE.Color;
|
|
3034
|
-
intensity: number;
|
|
3035
|
-
};
|
|
3036
|
-
}
|
|
3037
|
-
/**
|
|
3038
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
3039
|
-
*/
|
|
3040
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3041
|
-
/** {@link Configurable.isSetup} */
|
|
3042
|
-
isSetup: boolean;
|
|
3043
|
-
/**
|
|
3044
|
-
* The underlying Three.js scene object.
|
|
3045
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3046
|
-
*/
|
|
3047
|
-
three: THREE.Scene;
|
|
3048
|
-
/** {@link Configurable.onSetup} */
|
|
3049
|
-
readonly onSetup: Event<SimpleScene>;
|
|
3050
|
-
/**
|
|
3051
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
3052
|
-
* Defines properties for directional and ambient lights.
|
|
3053
|
-
*/
|
|
3054
|
-
config: Required<SimpleSceneConfig>;
|
|
3055
|
-
constructor(components: Components);
|
|
3056
|
-
/** {@link Configurable.setup} */
|
|
3057
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3058
|
-
}
|
|
3059
|
-
import * as THREE from "three";
|
|
3060
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
3061
|
-
import { Components } from "../../Components";
|
|
3062
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3063
|
-
/**
|
|
3064
|
-
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
3065
|
-
*/
|
|
3066
|
-
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
3067
|
-
/**
|
|
3068
|
-
* Event triggered when the visibility of meshes is updated.
|
|
3069
|
-
* Contains two sets: seen and unseen.
|
|
3070
|
-
*/
|
|
3071
|
-
readonly onViewUpdated: Event<{
|
|
3072
|
-
seen: Set<THREE.Mesh>;
|
|
3073
|
-
unseen: Set<THREE.Mesh>;
|
|
3074
|
-
}>;
|
|
3075
|
-
/**
|
|
3076
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
3077
|
-
* Default value is 100.
|
|
3078
|
-
*/
|
|
3079
|
-
threshold: number;
|
|
3080
|
-
/**
|
|
3081
|
-
* Map of color code to THREE.InstancedMesh.
|
|
3082
|
-
* Used to keep track of color-coded meshes.
|
|
3083
|
-
*/
|
|
3084
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
3085
|
-
/**
|
|
3086
|
-
* Flag to indicate if the renderer is currently processing.
|
|
3087
|
-
* Used to prevent concurrent processing.
|
|
3088
|
-
*/
|
|
3089
|
-
isProcessing: boolean;
|
|
3090
|
-
private _colorCodeMeshMap;
|
|
3091
|
-
private _meshIDColorCodeMap;
|
|
3092
|
-
private _currentVisibleMeshes;
|
|
3093
|
-
private _recentlyHiddenMeshes;
|
|
3094
|
-
private _intervalID;
|
|
3095
|
-
private readonly _transparentMat;
|
|
3096
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3097
|
-
/** {@link Disposable.dispose} */
|
|
3098
|
-
dispose(): void;
|
|
3099
|
-
/**
|
|
3100
|
-
* 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.
|
|
3101
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3102
|
-
* @returns {void}
|
|
3103
|
-
*/
|
|
3104
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3105
|
-
/**
|
|
3106
|
-
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
3107
|
-
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
3108
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
3109
|
-
* @returns {void}
|
|
3110
|
-
*/
|
|
3111
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
3112
|
-
/**
|
|
3113
|
-
* Updates the given instanced meshes inside the culler. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
3114
|
-
*
|
|
3115
|
-
* @param meshes - The meshes to update.
|
|
3116
|
-
*
|
|
3117
|
-
* @returns {void}
|
|
3118
|
-
*/
|
|
3119
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
3120
|
-
private handleWorkerMessage;
|
|
3121
|
-
private getAvailableMaterial;
|
|
3122
|
-
}
|
|
3123
|
-
import * as THREE from "three";
|
|
3124
|
-
import { Components } from "../../Components";
|
|
3125
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
3126
|
-
/**
|
|
3127
|
-
* Settings to configure the CullerRenderer.
|
|
3128
|
-
*/
|
|
3129
|
-
export interface CullerRendererSettings {
|
|
3130
|
-
/**
|
|
3131
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
3132
|
-
* Default value is 1000.
|
|
3133
|
-
*/
|
|
3134
|
-
updateInterval?: number;
|
|
3135
|
-
/**
|
|
3136
|
-
* Width of the render target used for visibility checks.
|
|
3137
|
-
* Default value is 512.
|
|
3138
|
-
*/
|
|
3139
|
-
width?: number;
|
|
3140
|
-
/**
|
|
3141
|
-
* Height of the render target used for visibility checks.
|
|
3142
|
-
* Default value is 512.
|
|
3143
|
-
*/
|
|
3144
|
-
height?: number;
|
|
3145
|
-
/**
|
|
3146
|
-
* Whether the visibility check should be performed automatically.
|
|
3147
|
-
* Default value is true.
|
|
3148
|
-
*/
|
|
3149
|
-
autoUpdate?: boolean;
|
|
3150
|
-
}
|
|
3151
|
-
/**
|
|
3152
|
-
* A base renderer to determine visibility on screen.
|
|
3153
|
-
*/
|
|
3154
|
-
export declare class CullerRenderer {
|
|
3155
|
-
/** {@link Disposable.onDisposed} */
|
|
3156
|
-
readonly onDisposed: Event<string>;
|
|
3157
|
-
/**
|
|
3158
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
3159
|
-
* meshes that are currently visible, and the ones that were visible
|
|
3160
|
-
* just before but not anymore.
|
|
3161
|
-
*/
|
|
3162
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
3163
|
-
/**
|
|
3164
|
-
* Whether this renderer is active or not. If not, it won't render anything.
|
|
3165
|
-
*/
|
|
3166
|
-
enabled: boolean;
|
|
3167
|
-
/**
|
|
3168
|
-
* Needs to check whether there are objects that need to be hidden or shown.
|
|
3169
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3170
|
-
*/
|
|
3171
|
-
needsUpdate: boolean;
|
|
3320
|
+
directionalLight: {
|
|
3321
|
+
color: THREE.Color;
|
|
3322
|
+
intensity: number;
|
|
3323
|
+
position: THREE.Vector3;
|
|
3324
|
+
};
|
|
3325
|
+
ambientLight: {
|
|
3326
|
+
color: THREE.Color;
|
|
3327
|
+
intensity: number;
|
|
3328
|
+
};
|
|
3329
|
+
}
|
|
3330
|
+
/**
|
|
3331
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add objects hierarchically, and easily dispose them when you are finished with it.
|
|
3332
|
+
*/
|
|
3333
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3334
|
+
/** {@link Configurable.isSetup} */
|
|
3335
|
+
isSetup: boolean;
|
|
3172
3336
|
/**
|
|
3173
|
-
*
|
|
3174
|
-
*
|
|
3337
|
+
* The underlying Three.js scene object.
|
|
3338
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3175
3339
|
*/
|
|
3176
|
-
|
|
3177
|
-
/**
|
|
3178
|
-
|
|
3179
|
-
/** The world instance to which this renderer belongs. */
|
|
3180
|
-
readonly world: World;
|
|
3181
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
3182
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
3183
|
-
protected autoUpdate: boolean;
|
|
3184
|
-
protected updateInterval: number;
|
|
3185
|
-
protected readonly worker: Worker;
|
|
3186
|
-
protected readonly scene: THREE.Scene;
|
|
3187
|
-
private _width;
|
|
3188
|
-
private _height;
|
|
3189
|
-
private _availableColor;
|
|
3190
|
-
private readonly renderTarget;
|
|
3191
|
-
private readonly bufferSize;
|
|
3192
|
-
private readonly _buffer;
|
|
3193
|
-
protected _isWorkerBusy: boolean;
|
|
3194
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3195
|
-
/** {@link Disposable.dispose} */
|
|
3196
|
-
dispose(): void;
|
|
3340
|
+
three: THREE.Scene;
|
|
3341
|
+
/** {@link Configurable.onSetup} */
|
|
3342
|
+
readonly onSetup: Event<SimpleScene>;
|
|
3197
3343
|
/**
|
|
3198
|
-
*
|
|
3199
|
-
*
|
|
3200
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
3201
|
-
* not true.
|
|
3344
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3345
|
+
* Defines properties for directional and ambient lights.
|
|
3202
3346
|
*/
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
b: number;
|
|
3208
|
-
code: string;
|
|
3209
|
-
};
|
|
3210
|
-
protected increaseColor(): void;
|
|
3211
|
-
protected decreaseColor(): void;
|
|
3212
|
-
private applySettings;
|
|
3347
|
+
config: Required<SimpleSceneConfig>;
|
|
3348
|
+
constructor(components: Components);
|
|
3349
|
+
/** {@link Configurable.setup} */
|
|
3350
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3213
3351
|
}
|
|
3214
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
3215
3352
|
import * as THREE from "three";
|
|
3216
3353
|
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
3217
3354
|
import { Components } from "../../Components";
|
|
@@ -3272,113 +3409,6 @@ export declare class SimpleGrid implements Hideable, Disposable {
|
|
|
3272
3409
|
private updateZoom;
|
|
3273
3410
|
}
|
|
3274
3411
|
import * as THREE from "three";
|
|
3275
|
-
import { Components } from "../../Components";
|
|
3276
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3277
|
-
import { Mouse } from "./mouse";
|
|
3278
|
-
/**
|
|
3279
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3280
|
-
*/
|
|
3281
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
3282
|
-
/** {@link Component.enabled} */
|
|
3283
|
-
enabled: boolean;
|
|
3284
|
-
/** The components instance to which this Raycaster belongs. */
|
|
3285
|
-
components: Components;
|
|
3286
|
-
/** {@link Disposable.onDisposed} */
|
|
3287
|
-
readonly onDisposed: Event<unknown>;
|
|
3288
|
-
/** The position of the mouse in the screen. */
|
|
3289
|
-
readonly mouse: Mouse;
|
|
3290
|
-
/**
|
|
3291
|
-
* A reference to the Three.js Raycaster instance.
|
|
3292
|
-
* This is used for raycasting operations.
|
|
3293
|
-
*/
|
|
3294
|
-
readonly three: THREE.Raycaster;
|
|
3295
|
-
/**
|
|
3296
|
-
* A reference to the world instance to which this Raycaster belongs.
|
|
3297
|
-
* This is used to access the camera and meshes.
|
|
3298
|
-
*/
|
|
3299
|
-
world: World;
|
|
3300
|
-
constructor(components: Components, world: World);
|
|
3301
|
-
/** {@link Disposable.dispose} */
|
|
3302
|
-
dispose(): void;
|
|
3303
|
-
/**
|
|
3304
|
-
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3305
|
-
* the first item found. This also takes into account the clipping planes
|
|
3306
|
-
* used by the renderer.
|
|
3307
|
-
*
|
|
3308
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3309
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
3310
|
-
* {@link Components.meshes}.
|
|
3311
|
-
*/
|
|
3312
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3313
|
-
/**
|
|
3314
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3315
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
3316
|
-
*
|
|
3317
|
-
* @param origin - The origin of the ray.
|
|
3318
|
-
* @param direction - The direction of the ray.
|
|
3319
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3320
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3321
|
-
*/
|
|
3322
|
-
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;
|
|
3323
|
-
private intersect;
|
|
3324
|
-
private filterClippingPlanes;
|
|
3325
|
-
}
|
|
3326
|
-
import * as THREE from "three";
|
|
3327
|
-
import { Disposable, Event } from "../../Types";
|
|
3328
|
-
/**
|
|
3329
|
-
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
3330
|
-
*/
|
|
3331
|
-
export declare class Mouse implements Disposable {
|
|
3332
|
-
dom: HTMLCanvasElement;
|
|
3333
|
-
private _event?;
|
|
3334
|
-
private _position;
|
|
3335
|
-
/** {@link Disposable.onDisposed} */
|
|
3336
|
-
readonly onDisposed: Event<unknown>;
|
|
3337
|
-
constructor(dom: HTMLCanvasElement);
|
|
3338
|
-
/**
|
|
3339
|
-
* The real position of the mouse of the Three.js canvas.
|
|
3340
|
-
*/
|
|
3341
|
-
get position(): THREE.Vector2;
|
|
3342
|
-
/** {@link Disposable.dispose} */
|
|
3343
|
-
dispose(): void;
|
|
3344
|
-
private getPositionY;
|
|
3345
|
-
private getPositionX;
|
|
3346
|
-
private updateMouseInfo;
|
|
3347
|
-
private setupEvents;
|
|
3348
|
-
}
|
|
3349
|
-
import { NavigationMode } from "./types";
|
|
3350
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3351
|
-
/**
|
|
3352
|
-
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3353
|
-
*/
|
|
3354
|
-
export declare class OrbitMode implements NavigationMode {
|
|
3355
|
-
camera: OrthoPerspectiveCamera;
|
|
3356
|
-
/** {@link NavigationMode.enabled} */
|
|
3357
|
-
enabled: boolean;
|
|
3358
|
-
/** {@link NavigationMode.id} */
|
|
3359
|
-
readonly id = "Orbit";
|
|
3360
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3361
|
-
/** {@link NavigationMode.set} */
|
|
3362
|
-
set(active: boolean): void;
|
|
3363
|
-
private activateOrbitControls;
|
|
3364
|
-
}
|
|
3365
|
-
import { NavigationMode } from "./types";
|
|
3366
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3367
|
-
/**
|
|
3368
|
-
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3369
|
-
*/
|
|
3370
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
3371
|
-
private camera;
|
|
3372
|
-
/** {@link NavigationMode.enabled} */
|
|
3373
|
-
enabled: boolean;
|
|
3374
|
-
/** {@link NavigationMode.id} */
|
|
3375
|
-
readonly id = "FirstPerson";
|
|
3376
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3377
|
-
/** {@link NavigationMode.set} */
|
|
3378
|
-
set(active: boolean): void;
|
|
3379
|
-
private setupFirstPersonCamera;
|
|
3380
|
-
}
|
|
3381
|
-
import * as THREE from "three";
|
|
3382
3412
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3383
3413
|
import { Components } from "../../Components";
|
|
3384
3414
|
/**
|
|
@@ -3443,141 +3473,230 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
3443
3473
|
/** Sets the size of the clipping plane representation. */
|
|
3444
3474
|
set size(size: number);
|
|
3445
3475
|
/**
|
|
3446
|
-
* Getter for the helper object of the clipping plane.
|
|
3447
|
-
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
3448
|
-
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3476
|
+
* Getter for the helper object of the clipping plane.
|
|
3477
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
3478
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3479
|
+
*
|
|
3480
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
3481
|
+
*/
|
|
3482
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3483
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
3484
|
+
/**
|
|
3485
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
3486
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
3487
|
+
* and positions the helper object accordingly.
|
|
3488
|
+
*
|
|
3489
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
3490
|
+
* @param point - The new origin point for the clipping plane.
|
|
3491
|
+
*
|
|
3492
|
+
* @returns {void}
|
|
3493
|
+
*/
|
|
3494
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
3495
|
+
/** {@link Updateable.update} */
|
|
3496
|
+
update: () => void;
|
|
3497
|
+
/** {@link Disposable.dispose} */
|
|
3498
|
+
dispose(): void;
|
|
3499
|
+
private reset;
|
|
3500
|
+
protected toggleControls(state: boolean): void;
|
|
3501
|
+
private newTransformControls;
|
|
3502
|
+
private initializeControls;
|
|
3503
|
+
private createArrowBoundingBox;
|
|
3504
|
+
private changeDrag;
|
|
3505
|
+
private notifyDraggingChanged;
|
|
3506
|
+
private preventCameraMovement;
|
|
3507
|
+
private newHelper;
|
|
3508
|
+
private static newPlaneMesh;
|
|
3509
|
+
}
|
|
3510
|
+
import * as THREE from "three";
|
|
3511
|
+
import { Disposable, Event } from "../../Types";
|
|
3512
|
+
/**
|
|
3513
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
3514
|
+
*/
|
|
3515
|
+
export declare class Mouse implements Disposable {
|
|
3516
|
+
dom: HTMLCanvasElement;
|
|
3517
|
+
private _event?;
|
|
3518
|
+
private _position;
|
|
3519
|
+
/** {@link Disposable.onDisposed} */
|
|
3520
|
+
readonly onDisposed: Event<unknown>;
|
|
3521
|
+
constructor(dom: HTMLCanvasElement);
|
|
3522
|
+
/**
|
|
3523
|
+
* The real position of the mouse of the Three.js canvas.
|
|
3524
|
+
*/
|
|
3525
|
+
get position(): THREE.Vector2;
|
|
3526
|
+
/** {@link Disposable.dispose} */
|
|
3527
|
+
dispose(): void;
|
|
3528
|
+
private getPositionY;
|
|
3529
|
+
private getPositionX;
|
|
3530
|
+
private updateMouseInfo;
|
|
3531
|
+
private setupEvents;
|
|
3532
|
+
}
|
|
3533
|
+
import * as THREE from "three";
|
|
3534
|
+
import CameraControls from "camera-controls";
|
|
3535
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
3536
|
+
import { Components } from "../../Components";
|
|
3537
|
+
/**
|
|
3538
|
+
* 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.
|
|
3539
|
+
*/
|
|
3540
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
3541
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
3542
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
3543
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
3544
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
3545
|
+
/**
|
|
3546
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
3547
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
3548
|
+
*/
|
|
3549
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
3550
|
+
/** {@link Disposable.onDisposed} */
|
|
3551
|
+
readonly onDisposed: Event<string>;
|
|
3552
|
+
/**
|
|
3553
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
3554
|
+
* This camera is used for rendering the scene.
|
|
3555
|
+
*/
|
|
3556
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3557
|
+
private _allControls;
|
|
3558
|
+
/**
|
|
3559
|
+
* The object that controls the camera. An instance of
|
|
3560
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
3561
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
3562
|
+
* object to move, rotate, look at objects, etc.
|
|
3563
|
+
*/
|
|
3564
|
+
get controls(): CameraControls;
|
|
3565
|
+
/**
|
|
3566
|
+
* Getter for the enabled state of the camera controls.
|
|
3567
|
+
* If the current world is null, it returns false.
|
|
3568
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
3449
3569
|
*
|
|
3450
|
-
* @returns {
|
|
3570
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
3451
3571
|
*/
|
|
3452
|
-
get
|
|
3453
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
3572
|
+
get enabled(): boolean;
|
|
3454
3573
|
/**
|
|
3455
|
-
*
|
|
3456
|
-
*
|
|
3457
|
-
* and positions the helper object accordingly.
|
|
3458
|
-
*
|
|
3459
|
-
* @param normal - The new normal vector for the clipping plane.
|
|
3460
|
-
* @param point - The new origin point for the clipping plane.
|
|
3574
|
+
* Setter for the enabled state of the camera controls.
|
|
3575
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
3461
3576
|
*
|
|
3462
|
-
* @
|
|
3577
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
3463
3578
|
*/
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
update: () => void;
|
|
3579
|
+
set enabled(enabled: boolean);
|
|
3580
|
+
constructor(components: Components);
|
|
3467
3581
|
/** {@link Disposable.dispose} */
|
|
3468
3582
|
dispose(): void;
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
private newTransformControls;
|
|
3472
|
-
private initializeControls;
|
|
3473
|
-
private createArrowBoundingBox;
|
|
3474
|
-
private changeDrag;
|
|
3475
|
-
private notifyDraggingChanged;
|
|
3476
|
-
private preventCameraMovement;
|
|
3477
|
-
private newHelper;
|
|
3478
|
-
private static newPlaneMesh;
|
|
3479
|
-
}
|
|
3480
|
-
/**
|
|
3481
|
-
* The projection system of the camera.
|
|
3482
|
-
*/
|
|
3483
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3484
|
-
/**
|
|
3485
|
-
* The extensible list of supported navigation modes.
|
|
3486
|
-
*/
|
|
3487
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3488
|
-
/**
|
|
3489
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3490
|
-
*/
|
|
3491
|
-
export interface NavigationMode {
|
|
3492
|
-
/** The unique ID of this navigation mode. */
|
|
3493
|
-
id: NavModeID;
|
|
3583
|
+
/** {@link Updateable.update} */
|
|
3584
|
+
update(_delta: number): void;
|
|
3494
3585
|
/**
|
|
3495
|
-
*
|
|
3496
|
-
*
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
/** Whether this navigation mode is active or not. */
|
|
3504
|
-
enabled: boolean;
|
|
3586
|
+
* Updates the aspect of the camera to match the size of the
|
|
3587
|
+
* {@link Components.renderer}.
|
|
3588
|
+
*/
|
|
3589
|
+
updateAspect: () => void;
|
|
3590
|
+
private setupCamera;
|
|
3591
|
+
private newCameraControls;
|
|
3592
|
+
private setupEvents;
|
|
3593
|
+
private static getSubsetOfThree;
|
|
3505
3594
|
}
|
|
3506
3595
|
import * as THREE from "three";
|
|
3507
|
-
import {
|
|
3508
|
-
import { Event } from "../../Types";
|
|
3509
|
-
import {
|
|
3596
|
+
import { Components } from "../../Components";
|
|
3597
|
+
import { Event, World, Disposable } from "../../Types";
|
|
3598
|
+
import { Mouse } from "./mouse";
|
|
3510
3599
|
/**
|
|
3511
|
-
*
|
|
3600
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3512
3601
|
*/
|
|
3513
|
-
export declare class
|
|
3514
|
-
/**
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3602
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
3603
|
+
/** {@link Component.enabled} */
|
|
3604
|
+
enabled: boolean;
|
|
3605
|
+
/** The components instance to which this Raycaster belongs. */
|
|
3606
|
+
components: Components;
|
|
3607
|
+
/** {@link Disposable.onDisposed} */
|
|
3608
|
+
readonly onDisposed: Event<unknown>;
|
|
3609
|
+
/** The position of the mouse in the screen. */
|
|
3610
|
+
readonly mouse: Mouse;
|
|
3518
3611
|
/**
|
|
3519
|
-
*
|
|
3520
|
-
*
|
|
3612
|
+
* A reference to the Three.js Raycaster instance.
|
|
3613
|
+
* This is used for raycasting operations.
|
|
3521
3614
|
*/
|
|
3522
|
-
|
|
3615
|
+
readonly three: THREE.Raycaster;
|
|
3523
3616
|
/**
|
|
3524
|
-
*
|
|
3525
|
-
*
|
|
3617
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
3618
|
+
* This is used to access the camera and meshes.
|
|
3526
3619
|
*/
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
private _previousDistance;
|
|
3532
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
3620
|
+
world: World;
|
|
3621
|
+
constructor(components: Components, world: World);
|
|
3622
|
+
/** {@link Disposable.dispose} */
|
|
3623
|
+
dispose(): void;
|
|
3533
3624
|
/**
|
|
3534
|
-
*
|
|
3625
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
3626
|
+
* the first item found. This also takes into account the clipping planes
|
|
3627
|
+
* used by the renderer.
|
|
3535
3628
|
*
|
|
3536
|
-
* @param
|
|
3537
|
-
* it will
|
|
3629
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3630
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
3631
|
+
* {@link Components.meshes}.
|
|
3538
3632
|
*/
|
|
3539
|
-
|
|
3633
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3540
3634
|
/**
|
|
3541
|
-
*
|
|
3542
|
-
*
|
|
3635
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3636
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
3637
|
+
*
|
|
3638
|
+
* @param origin - The origin of the ray.
|
|
3639
|
+
* @param direction - The direction of the ray.
|
|
3640
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3641
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
3543
3642
|
*/
|
|
3544
|
-
|
|
3545
|
-
private
|
|
3546
|
-
private
|
|
3547
|
-
private setupOrthoCamera;
|
|
3548
|
-
private getDistance;
|
|
3549
|
-
private setPerspectiveCamera;
|
|
3643
|
+
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;
|
|
3644
|
+
private intersect;
|
|
3645
|
+
private filterClippingPlanes;
|
|
3550
3646
|
}
|
|
3551
|
-
import
|
|
3647
|
+
import * as THREE from "three";
|
|
3648
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
3649
|
+
import { Components } from "../../Components";
|
|
3552
3650
|
/**
|
|
3553
|
-
*
|
|
3651
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
3554
3652
|
*/
|
|
3555
|
-
export declare class
|
|
3653
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
3556
3654
|
/**
|
|
3557
|
-
*
|
|
3558
|
-
*
|
|
3655
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
3656
|
+
* Default is 'true'.
|
|
3559
3657
|
*/
|
|
3560
|
-
propertiesSize: number;
|
|
3561
|
-
}
|
|
3562
|
-
import { NavigationMode } from "./types";
|
|
3563
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3564
|
-
/**
|
|
3565
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3566
|
-
*/
|
|
3567
|
-
export declare class PlanMode implements NavigationMode {
|
|
3568
|
-
private camera;
|
|
3569
|
-
/** {@link NavigationMode.enabled} */
|
|
3570
3658
|
enabled: boolean;
|
|
3571
|
-
/**
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3659
|
+
/**
|
|
3660
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
3661
|
+
*/
|
|
3662
|
+
container: HTMLElement;
|
|
3663
|
+
/**
|
|
3664
|
+
* The THREE.js WebGLRenderer instance.
|
|
3665
|
+
*/
|
|
3666
|
+
three: THREE.WebGLRenderer;
|
|
3667
|
+
protected _canvas: HTMLCanvasElement;
|
|
3668
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
3669
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
3670
|
+
protected onContainerUpdated: Event<unknown>;
|
|
3671
|
+
private _resizing;
|
|
3672
|
+
/**
|
|
3673
|
+
* Constructor for the SimpleRenderer class.
|
|
3674
|
+
*
|
|
3675
|
+
* @param components - The components instance.
|
|
3676
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
3677
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
3678
|
+
*/
|
|
3679
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
3680
|
+
/** {@link Updateable.update} */
|
|
3681
|
+
update(): void;
|
|
3682
|
+
/** {@link Disposable.dispose} */
|
|
3683
|
+
dispose(): void;
|
|
3684
|
+
/** {@link Resizeable.getSize}. */
|
|
3685
|
+
getSize(): THREE.Vector2;
|
|
3686
|
+
/** {@link Resizeable.resize} */
|
|
3687
|
+
resize: (size?: THREE.Vector2) => void;
|
|
3688
|
+
/**
|
|
3689
|
+
* Sets up and manages the event listeners for the renderer.
|
|
3690
|
+
*
|
|
3691
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
3692
|
+
*
|
|
3693
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
3694
|
+
*/
|
|
3695
|
+
setupEvents(active: boolean): void;
|
|
3696
|
+
private resizeEvent;
|
|
3697
|
+
private setupRenderer;
|
|
3698
|
+
private onContextLost;
|
|
3699
|
+
private onContextBack;
|
|
3581
3700
|
}
|
|
3582
3701
|
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3583
3702
|
/**
|
|
@@ -3595,10 +3714,16 @@ export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
|
3595
3714
|
*/
|
|
3596
3715
|
minAssetsSize: number;
|
|
3597
3716
|
}
|
|
3598
|
-
import
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3717
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3718
|
+
/**
|
|
3719
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3720
|
+
*/
|
|
3721
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3722
|
+
/**
|
|
3723
|
+
* Amount of properties to be streamed.
|
|
3724
|
+
* Defaults to 100 properties.
|
|
3725
|
+
*/
|
|
3726
|
+
propertiesSize: number;
|
|
3602
3727
|
}
|
|
3603
3728
|
import * as THREE from "three";
|
|
3604
3729
|
import * as WEBIFC from "web-ifc";
|
|
@@ -3645,14 +3770,9 @@ export interface StreamedAsset {
|
|
|
3645
3770
|
}[];
|
|
3646
3771
|
}
|
|
3647
3772
|
import * as WEBIFC from "web-ifc";
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
complement: number;
|
|
3652
|
-
apply(matrix: THREE.Matrix4): void;
|
|
3653
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3654
|
-
private getLengthUnits;
|
|
3655
|
-
private getScaleMatrix;
|
|
3773
|
+
export declare class IfcMetadataReader {
|
|
3774
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3775
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3656
3776
|
}
|
|
3657
3777
|
import * as WEBIFC from "web-ifc";
|
|
3658
3778
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
@@ -3680,7 +3800,8 @@ export type InverseAttributes = [
|
|
|
3680
3800
|
"HasControlElements",
|
|
3681
3801
|
"AssignedToFlowElement",
|
|
3682
3802
|
"ConnectedTo",
|
|
3683
|
-
"ConnectedFrom"
|
|
3803
|
+
"ConnectedFrom",
|
|
3804
|
+
"ReferencedBy"
|
|
3684
3805
|
];
|
|
3685
3806
|
export type InverseAttribute = InverseAttributes[number];
|
|
3686
3807
|
/**
|
|
@@ -3696,9 +3817,20 @@ export type IfcRelations = [
|
|
|
3696
3817
|
typeof WEBIFC.IFCRELDEFINESBYTEMPLATE,
|
|
3697
3818
|
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
|
|
3698
3819
|
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
|
|
3699
|
-
typeof WEBIFC.IFCRELCONNECTSELEMENTS
|
|
3820
|
+
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
|
|
3821
|
+
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT
|
|
3700
3822
|
];
|
|
3701
3823
|
export type IfcRelation = IfcRelations[number];
|
|
3824
|
+
import * as WEBIFC from "web-ifc";
|
|
3825
|
+
import * as THREE from "three";
|
|
3826
|
+
export declare class Units {
|
|
3827
|
+
factor: number;
|
|
3828
|
+
complement: number;
|
|
3829
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3830
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3831
|
+
private getLengthUnits;
|
|
3832
|
+
private getScaleMatrix;
|
|
3833
|
+
}
|
|
3702
3834
|
import { BufferGeometry } from "three";
|
|
3703
3835
|
import * as THREE from "three";
|
|
3704
3836
|
export declare class TransformHelper {
|