@thatopen/components 2.0.9 → 2.0.11
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/Clipper/index.d.ts +34 -6
- package/dist/core/Clipper/src/simple-plane.d.ts +40 -4
- package/dist/core/Components/index.d.ts +40 -16
- package/dist/core/Cullers/index.d.ts +23 -27
- package/dist/core/Cullers/src/culler-renderer.d.ts +26 -2
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +32 -4
- package/dist/core/Disposer/index.d.ts +6 -4
- package/dist/core/Grids/index.d.ts +35 -1
- package/dist/core/Grids/src/simple-grid.d.ts +3 -0
- package/dist/core/MiniMap/index.d.ts +31 -0
- package/dist/core/MiniMap/src/index.d.ts +55 -0
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +19 -6
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +1 -2
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +1 -2
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +1 -2
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +10 -2
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +1 -2
- package/dist/core/Raycasters/index.d.ts +29 -0
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +18 -0
- package/dist/core/Types/src/async-event.d.ts +1 -7
- package/dist/core/Types/src/base-camera.d.ts +18 -1
- package/dist/core/Types/src/base-renderer.d.ts +34 -9
- package/dist/core/Types/src/base-scene.d.ts +7 -0
- package/dist/core/Types/src/base-world-item.d.ts +8 -2
- package/dist/core/Types/src/base.d.ts +1 -1
- package/dist/core/Types/src/component.d.ts +1 -6
- package/dist/core/Types/src/event.d.ts +1 -7
- package/dist/core/Types/src/interfaces.d.ts +9 -24
- package/dist/core/Types/src/world.d.ts +21 -0
- package/dist/core/Worlds/index.d.ts +31 -15
- package/dist/core/Worlds/src/simple-camera.d.ts +22 -6
- package/dist/core/Worlds/src/simple-renderer.d.ts +25 -3
- package/dist/core/Worlds/src/simple-scene.d.ts +13 -4
- package/dist/core/Worlds/src/simple-world.d.ts +57 -6
- package/dist/fragments/BoundingBoxer/index.d.ts +1 -2
- package/dist/fragments/FragmentsManager/index.d.ts +22 -2
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +1 -2
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +861 -382
- package/dist/namespace.d.ts +1414 -913
- package/package.json +2 -2
package/dist/namespace.d.ts
CHANGED
|
@@ -1,35 +1,59 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
2
|
import { Component, Disposable, Event } from "../Types";
|
|
3
3
|
/**
|
|
4
|
-
* The entry point of the Components library.
|
|
5
|
-
* It can:
|
|
6
|
-
* - Create and access all the components of the library.
|
|
7
|
-
* - Update all the updatable components automatically.
|
|
8
|
-
* - Dispose all the components, preventing memory leaks.
|
|
4
|
+
* The entry point of the Components library. It can create and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
9
5
|
*/
|
|
10
6
|
export declare class Components implements Disposable {
|
|
11
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The version of the @thatopen/components library.
|
|
9
|
+
*/
|
|
10
|
+
static readonly release = "2.0.11";
|
|
12
11
|
/** {@link Disposable.onDisposed} */
|
|
13
12
|
readonly onDisposed: Event<void>;
|
|
14
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The list of components created in this app.
|
|
15
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
16
|
+
*/
|
|
15
17
|
readonly list: Map<string, Component>;
|
|
16
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* If disabled, the animation loop will be stopped.
|
|
20
|
+
* Default value is false.
|
|
21
|
+
*/
|
|
17
22
|
enabled: boolean;
|
|
18
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
|
+
*/
|
|
19
35
|
add(uuid: string, instance: Component): void;
|
|
20
36
|
/**
|
|
21
|
-
* Retrieves a component
|
|
22
|
-
*
|
|
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.
|
|
23
42
|
*
|
|
24
|
-
* @
|
|
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
|
|
25
48
|
*/
|
|
26
49
|
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
27
50
|
constructor();
|
|
28
51
|
/**
|
|
29
|
-
* Initializes the
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
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}
|
|
33
57
|
*/
|
|
34
58
|
init(): void;
|
|
35
59
|
/**
|
|
@@ -40,7 +64,7 @@ export declare class Components implements Disposable {
|
|
|
40
64
|
* called. This is especially relevant in Single Page Applications (React,
|
|
41
65
|
* Angular, Vue, etc).
|
|
42
66
|
*
|
|
43
|
-
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
67
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
44
68
|
* referenced by a reference type (object or array).
|
|
45
69
|
*
|
|
46
70
|
* You can learn more about how Three.js handles memory leaks
|
|
@@ -55,18 +79,20 @@ import * as THREE from "three";
|
|
|
55
79
|
import { Components } from "../Components";
|
|
56
80
|
import { Component } from "../Types";
|
|
57
81
|
/**
|
|
58
|
-
* A tool to safely remove meshes and geometries from memory to
|
|
59
|
-
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
82
|
+
* A tool to safely remove meshes and geometries from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
60
83
|
*/
|
|
61
84
|
export declare class Disposer extends Component {
|
|
62
85
|
private _disposedComponents;
|
|
63
86
|
/** {@link Component.enabled} */
|
|
64
87
|
enabled: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* A unique identifier for the component.
|
|
90
|
+
* This UUID is used to register the component within the Components system.
|
|
91
|
+
*/
|
|
65
92
|
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
66
93
|
constructor(components: Components);
|
|
67
94
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @return the list of UUIDs of deleted components.
|
|
95
|
+
* Return the UUIDs of all disposed components.
|
|
70
96
|
*/
|
|
71
97
|
get(): Set<string>;
|
|
72
98
|
/**
|
|
@@ -97,66 +123,79 @@ export declare class Disposer extends Component {
|
|
|
97
123
|
import { Component, Disposable, World, Event } from "../Types";
|
|
98
124
|
import { SimpleRaycaster } from "./src";
|
|
99
125
|
import { Components } from "../Components";
|
|
126
|
+
/**
|
|
127
|
+
* A component that manages raycasters for different worlds. It uses a Map to store raycasters for each world, and automatically disposes them when the world is disposed.
|
|
128
|
+
*/
|
|
100
129
|
export declare class Raycasters extends Component implements Disposable {
|
|
130
|
+
/**
|
|
131
|
+
* A unique identifier for the component.
|
|
132
|
+
* This UUID is used to register the component within the Components system.
|
|
133
|
+
*/
|
|
101
134
|
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
135
|
+
/** {@link Component.enabled} */
|
|
102
136
|
enabled: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* A Map that stores raycasters for each world.
|
|
139
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
140
|
+
*/
|
|
103
141
|
list: Map<string, SimpleRaycaster>;
|
|
142
|
+
/** {@link Disposable.onDisposed} */
|
|
104
143
|
onDisposed: Event<unknown>;
|
|
105
144
|
constructor(components: Components);
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
147
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
148
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
149
|
+
*
|
|
150
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
151
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
152
|
+
*/
|
|
106
153
|
get(world: World): SimpleRaycaster;
|
|
154
|
+
/**
|
|
155
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
156
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
157
|
+
*
|
|
158
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
159
|
+
* @returns {void}
|
|
160
|
+
*/
|
|
107
161
|
delete(world: World): void;
|
|
108
|
-
dispose
|
|
109
|
-
}
|
|
110
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
111
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
112
|
-
import { Components } from "../Components";
|
|
113
|
-
export declare class Grids extends Component implements Disposable {
|
|
114
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
115
|
-
list: Map<string, SimpleGrid>;
|
|
116
|
-
readonly onDisposed: Event<unknown>;
|
|
117
|
-
config: Required<GridConfig>;
|
|
118
|
-
/** {@link Component.enabled} */
|
|
119
|
-
enabled: boolean;
|
|
120
|
-
constructor(components: Components);
|
|
121
|
-
create(world: World): SimpleGrid;
|
|
122
|
-
delete(world: World): void;
|
|
162
|
+
/** {@link Disposable.dispose} */
|
|
123
163
|
dispose(): void;
|
|
124
164
|
}
|
|
125
165
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
126
166
|
import { Components } from "../Components";
|
|
127
167
|
import { SimpleWorld } from "./src";
|
|
168
|
+
/**
|
|
169
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds.
|
|
170
|
+
*/
|
|
128
171
|
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
129
172
|
/**
|
|
130
173
|
* A unique identifier for the component.
|
|
131
174
|
* This UUID is used to register the component within the Components system.
|
|
132
175
|
*/
|
|
133
176
|
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
134
|
-
/**
|
|
135
|
-
* Event triggered after the update process of all worlds.
|
|
136
|
-
* Subscribers can listen to this event to perform actions post-update.
|
|
137
|
-
*/
|
|
177
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
138
178
|
readonly onAfterUpdate: Event<unknown>;
|
|
139
|
-
/**
|
|
140
|
-
* Event triggered before the update process of all worlds.
|
|
141
|
-
* Subscribers can listen to this event to perform actions pre-update.
|
|
142
|
-
*/
|
|
179
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
143
180
|
readonly onBeforeUpdate: Event<unknown>;
|
|
181
|
+
/** {@link Disposable.onDisposed} */
|
|
182
|
+
readonly onDisposed: Event<unknown>;
|
|
144
183
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
184
|
+
* An event that is triggered when a new world is created.
|
|
185
|
+
* The event passes the newly created world as a parameter.
|
|
147
186
|
*/
|
|
148
|
-
readonly onDisposed: Event<unknown>;
|
|
149
187
|
readonly onWorldCreated: Event<World>;
|
|
188
|
+
/**
|
|
189
|
+
* An event that is triggered when a world is deleted.
|
|
190
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
191
|
+
*/
|
|
150
192
|
readonly onWorldDeleted: Event<string>;
|
|
151
193
|
/**
|
|
152
194
|
* A collection of worlds managed by this component.
|
|
153
195
|
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
154
196
|
*/
|
|
155
197
|
list: Map<string, World>;
|
|
156
|
-
/**
|
|
157
|
-
* A flag indicating whether the Worlds component is enabled.
|
|
158
|
-
* If false, the update process will be skipped.
|
|
159
|
-
*/
|
|
198
|
+
/** {@link Component.enabled} */
|
|
160
199
|
enabled: boolean;
|
|
161
200
|
constructor(components: Components);
|
|
162
201
|
/**
|
|
@@ -169,35 +208,122 @@ export declare class Worlds extends Component implements Updateable, Disposable
|
|
|
169
208
|
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
170
209
|
*/
|
|
171
210
|
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
211
|
+
/**
|
|
212
|
+
* Deletes a world from the list of worlds.
|
|
213
|
+
*
|
|
214
|
+
* @param {World} world - The world to be deleted.
|
|
215
|
+
*
|
|
216
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
217
|
+
*
|
|
218
|
+
* @returns {void}
|
|
219
|
+
*/
|
|
172
220
|
delete(world: World): void;
|
|
221
|
+
/**
|
|
222
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
223
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
224
|
+
* and triggers the onDisposed event.
|
|
225
|
+
*
|
|
226
|
+
* @returns {void}
|
|
227
|
+
*/
|
|
173
228
|
dispose(): void;
|
|
229
|
+
/** {@link Updateable.update} */
|
|
174
230
|
update(delta?: number): void | Promise<void>;
|
|
175
231
|
}
|
|
232
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
233
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
234
|
+
import { Components } from "../Components";
|
|
235
|
+
/**
|
|
236
|
+
* A component that manages and provides access to multiple grid instances. Each grid is associated with a unique world.
|
|
237
|
+
*/
|
|
238
|
+
export declare class Grids extends Component implements Disposable {
|
|
239
|
+
/**
|
|
240
|
+
* A unique identifier for the component.
|
|
241
|
+
* This UUID is used to register the component within the Components system.
|
|
242
|
+
*/
|
|
243
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
244
|
+
/**
|
|
245
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
246
|
+
*/
|
|
247
|
+
list: Map<string, SimpleGrid>;
|
|
248
|
+
/**
|
|
249
|
+
* The default configuration for grid creation.
|
|
250
|
+
*/
|
|
251
|
+
config: Required<GridConfig>;
|
|
252
|
+
/** {@link Disposable.onDisposed} */
|
|
253
|
+
readonly onDisposed: Event<unknown>;
|
|
254
|
+
/** {@link Component.enabled} */
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
constructor(components: Components);
|
|
257
|
+
/**
|
|
258
|
+
* Creates a new grid for the given world.
|
|
259
|
+
* Throws an error if a grid already exists for the world.
|
|
260
|
+
*
|
|
261
|
+
* @param world - The world to create the grid for.
|
|
262
|
+
* @returns The newly created grid.
|
|
263
|
+
*
|
|
264
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
265
|
+
*/
|
|
266
|
+
create(world: World): SimpleGrid;
|
|
267
|
+
/**
|
|
268
|
+
* Deletes the grid associated with the given world.
|
|
269
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
270
|
+
*
|
|
271
|
+
* @param world - The world for which to delete the grid.
|
|
272
|
+
*
|
|
273
|
+
* @remarks
|
|
274
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
275
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
276
|
+
*/
|
|
277
|
+
delete(world: World): void;
|
|
278
|
+
/** {@link Disposable.dispose} */
|
|
279
|
+
dispose(): void;
|
|
280
|
+
}
|
|
176
281
|
import * as THREE from "three";
|
|
177
282
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
178
283
|
import { SimplePlane } from "./src";
|
|
179
284
|
import { Components } from "../Components";
|
|
180
285
|
/**
|
|
181
|
-
* A lightweight component to easily create and handle
|
|
182
|
-
* [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
286
|
+
* A lightweight component to easily create and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
183
287
|
*
|
|
184
288
|
* @param components - the instance of {@link Components} used.
|
|
185
289
|
* E.g. {@link SimplePlane}.
|
|
186
290
|
*/
|
|
187
291
|
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
292
|
+
/**
|
|
293
|
+
* A unique identifier for the component.
|
|
294
|
+
* This UUID is used to register the component within the Components system.
|
|
295
|
+
*/
|
|
188
296
|
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
189
|
-
/** {@link Createable.onAfterCreate} */
|
|
190
|
-
readonly onAfterCreate: Event<SimplePlane>;
|
|
191
|
-
/** {@link Createable.onAfterDelete} */
|
|
192
|
-
readonly onAfterDelete: Event<SimplePlane>;
|
|
193
297
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
194
298
|
readonly onBeforeDrag: Event<void>;
|
|
195
299
|
/** Event that fires when the user stops dragging a clipping plane. */
|
|
196
300
|
readonly onAfterDrag: Event<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
303
|
+
*/
|
|
197
304
|
readonly onBeforeCreate: Event<unknown>;
|
|
305
|
+
/**
|
|
306
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
307
|
+
*/
|
|
198
308
|
readonly onBeforeCancel: Event<unknown>;
|
|
309
|
+
/**
|
|
310
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
311
|
+
*/
|
|
199
312
|
readonly onAfterCancel: Event<unknown>;
|
|
313
|
+
/**
|
|
314
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
315
|
+
*/
|
|
200
316
|
readonly onBeforeDelete: Event<unknown>;
|
|
317
|
+
/**
|
|
318
|
+
* Event that fires after a clipping plane has been created.
|
|
319
|
+
* @param plane - The newly created clipping plane.
|
|
320
|
+
*/
|
|
321
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
322
|
+
/**
|
|
323
|
+
* Event that fires after a clipping plane has been deleted.
|
|
324
|
+
* @param plane - The deleted clipping plane.
|
|
325
|
+
*/
|
|
326
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
201
327
|
/** {@link Disposable.onDisposed} */
|
|
202
328
|
readonly onDisposed: Event<string>;
|
|
203
329
|
/**
|
|
@@ -213,7 +339,14 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
213
339
|
* has to be 'true' for this to apply.
|
|
214
340
|
*/
|
|
215
341
|
toleranceOrthogonalY: number;
|
|
342
|
+
/**
|
|
343
|
+
* The type of clipping plane to be created.
|
|
344
|
+
* Default is {@link SimplePlane}.
|
|
345
|
+
*/
|
|
216
346
|
Type: new (...args: any) => SimplePlane;
|
|
347
|
+
/**
|
|
348
|
+
* A list of all the clipping planes created by this component.
|
|
349
|
+
*/
|
|
217
350
|
list: SimplePlane[];
|
|
218
351
|
/** The material used in all the clipping planes. */
|
|
219
352
|
private _material;
|
|
@@ -272,96 +405,101 @@ export declare class Clipper extends Component implements Createable, Disposable
|
|
|
272
405
|
private _onStartDragging;
|
|
273
406
|
private _onEndDragging;
|
|
274
407
|
}
|
|
408
|
+
import * as THREE from "three";
|
|
409
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
410
|
+
center: THREE.Vector3;
|
|
411
|
+
halfSizes: THREE.Vector3;
|
|
412
|
+
rotation: THREE.Matrix3;
|
|
413
|
+
transformation: THREE.Matrix4;
|
|
414
|
+
};
|
|
415
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
416
|
+
import * as THREE from "three";
|
|
417
|
+
export declare class MaterialsUtils {
|
|
418
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
419
|
+
}
|
|
275
420
|
import { Components } from "../Components";
|
|
276
421
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
277
422
|
import { Component, Event, Disposable, World } from "../Types";
|
|
278
423
|
/**
|
|
279
|
-
* A
|
|
280
|
-
* that are not visible to the camera.
|
|
424
|
+
* A component that manages and provides culling functionality for meshes in a 3D scene.
|
|
281
425
|
*/
|
|
282
426
|
export declare class Cullers extends Component implements Disposable {
|
|
283
427
|
/**
|
|
284
|
-
* A unique identifier for the
|
|
428
|
+
* A unique identifier for the component.
|
|
429
|
+
* This UUID is used to register the component within the Components system.
|
|
285
430
|
*/
|
|
286
431
|
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
287
432
|
/**
|
|
288
|
-
|
|
289
|
-
|
|
433
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
434
|
+
*/
|
|
435
|
+
readonly onDisposed: Event<unknown>;
|
|
290
436
|
private _enabled;
|
|
291
437
|
/**
|
|
292
438
|
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
293
439
|
*/
|
|
294
440
|
list: Map<string, MeshCullerRenderer>;
|
|
441
|
+
/** {@link Component.enabled} */
|
|
442
|
+
get enabled(): boolean;
|
|
443
|
+
/** {@link Component.enabled} */
|
|
444
|
+
set enabled(value: boolean);
|
|
445
|
+
constructor(components: Components);
|
|
295
446
|
/**
|
|
296
|
-
*
|
|
297
|
-
|
|
298
|
-
readonly onDisposed: Event<unknown>;
|
|
299
|
-
/**
|
|
300
|
-
* Gets the enabled state of the Cullers component.
|
|
447
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
448
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
301
449
|
*
|
|
302
|
-
* @
|
|
450
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
451
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
452
|
+
*
|
|
453
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
303
454
|
*/
|
|
304
|
-
|
|
455
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
305
456
|
/**
|
|
306
|
-
*
|
|
307
|
-
*
|
|
457
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
458
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
459
|
+
*
|
|
460
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
308
461
|
*
|
|
309
|
-
* @
|
|
462
|
+
* @returns {void}
|
|
310
463
|
*/
|
|
311
|
-
set enabled(value: boolean);
|
|
312
|
-
constructor(components: Components);
|
|
313
|
-
/**
|
|
314
|
-
* Creates a new MeshCullerRenderer for the given world.
|
|
315
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
316
|
-
*
|
|
317
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
318
|
-
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
319
|
-
*
|
|
320
|
-
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
321
|
-
*/
|
|
322
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
323
464
|
delete(world: World): void;
|
|
324
465
|
/** {@link Disposable.dispose} */
|
|
325
466
|
dispose(): void;
|
|
326
467
|
}
|
|
327
|
-
import { MiniMap } from "./src";
|
|
328
|
-
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
329
|
-
import { Components } from "../Components";
|
|
330
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
331
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
332
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
333
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
334
|
-
readonly onDisposed: Event<unknown>;
|
|
335
|
-
enabled: boolean;
|
|
336
|
-
list: Map<string, MiniMap>;
|
|
337
|
-
constructor(components: Components);
|
|
338
|
-
create(world: World): MiniMap;
|
|
339
|
-
delete(id: string): void;
|
|
340
|
-
dispose(): void;
|
|
341
|
-
update(): void;
|
|
342
|
-
}
|
|
343
468
|
import * as THREE from "three";
|
|
344
469
|
import { Components } from "../Components";
|
|
345
470
|
import { SimpleCamera } from "..";
|
|
346
471
|
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
347
472
|
/**
|
|
348
|
-
* A flexible camera that uses
|
|
349
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
350
|
-
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
351
|
-
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
473
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to easily 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.
|
|
352
474
|
*/
|
|
353
475
|
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
354
476
|
/**
|
|
355
|
-
*
|
|
477
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
356
478
|
*/
|
|
357
|
-
_mode: NavigationMode | null;
|
|
358
479
|
readonly projection: ProjectionManager;
|
|
480
|
+
/**
|
|
481
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
482
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
483
|
+
*/
|
|
359
484
|
readonly threeOrtho: THREE.OrthographicCamera;
|
|
485
|
+
/**
|
|
486
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
487
|
+
* This camera is used when the projection mode is set to perspective.
|
|
488
|
+
*/
|
|
360
489
|
readonly threePersp: THREE.PerspectiveCamera;
|
|
361
490
|
protected readonly _userInputButtons: any;
|
|
362
491
|
protected readonly _frustumSize = 50;
|
|
363
492
|
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
493
|
+
protected _mode: NavigationMode | null;
|
|
364
494
|
private previousSize;
|
|
495
|
+
/**
|
|
496
|
+
* Getter for the current navigation mode.
|
|
497
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
498
|
+
*
|
|
499
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
500
|
+
*
|
|
501
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
502
|
+
*/
|
|
365
503
|
get mode(): NavigationMode;
|
|
366
504
|
constructor(components: Components);
|
|
367
505
|
/** {@link Disposable.dispose} */
|
|
@@ -391,6 +529,53 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
391
529
|
private newOrthoCamera;
|
|
392
530
|
private setOrthoPerspCameraAspect;
|
|
393
531
|
}
|
|
532
|
+
import { MiniMap } from "./src";
|
|
533
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
534
|
+
import { Components } from "../Components";
|
|
535
|
+
/**
|
|
536
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID.
|
|
537
|
+
*/
|
|
538
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
539
|
+
/**
|
|
540
|
+
* A unique identifier for the component.
|
|
541
|
+
* This UUID is used to register the component within the Components system.
|
|
542
|
+
*/
|
|
543
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
544
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
545
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
546
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
547
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
548
|
+
/** {@link Disposable.onDisposed} */
|
|
549
|
+
readonly onDisposed: Event<unknown>;
|
|
550
|
+
/** {@link Component.enabled} */
|
|
551
|
+
enabled: boolean;
|
|
552
|
+
/**
|
|
553
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
554
|
+
*/
|
|
555
|
+
list: Map<string, MiniMap>;
|
|
556
|
+
constructor(components: Components);
|
|
557
|
+
/**
|
|
558
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
559
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
560
|
+
*
|
|
561
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
562
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
563
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
564
|
+
*/
|
|
565
|
+
create(world: World): MiniMap;
|
|
566
|
+
/**
|
|
567
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
568
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
569
|
+
*
|
|
570
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
571
|
+
* @returns {void}
|
|
572
|
+
*/
|
|
573
|
+
delete(id: string): void;
|
|
574
|
+
/** {@link Disposable.dispose} */
|
|
575
|
+
dispose(): void;
|
|
576
|
+
/** {@link Updateable.update} */
|
|
577
|
+
update(): void;
|
|
578
|
+
}
|
|
394
579
|
import * as THREE from "three";
|
|
395
580
|
import { Component, Components } from "../../core";
|
|
396
581
|
export interface MeasureEdge {
|
|
@@ -415,34 +600,302 @@ export declare class MeasurementUtils extends Component {
|
|
|
415
600
|
};
|
|
416
601
|
private round;
|
|
417
602
|
}
|
|
418
|
-
import * as
|
|
419
|
-
import * as
|
|
420
|
-
import {
|
|
421
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
603
|
+
import * as WEBIFC from "web-ifc";
|
|
604
|
+
import * as FRAG from "@thatopen/fragments";
|
|
605
|
+
import { Component, Components } from "../../core";
|
|
422
606
|
/**
|
|
423
|
-
*
|
|
424
|
-
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
607
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
425
608
|
*/
|
|
426
|
-
export declare class
|
|
427
|
-
static readonly uuid: "
|
|
609
|
+
export declare class IfcJsonExporter extends Component {
|
|
610
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
428
611
|
/** {@link Component.enabled} */
|
|
429
612
|
enabled: boolean;
|
|
430
|
-
/** {@link Disposable.onDisposed} */
|
|
431
|
-
readonly onDisposed: Event<unknown>;
|
|
432
|
-
private _absoluteMin;
|
|
433
|
-
private _absoluteMax;
|
|
434
|
-
private _meshes;
|
|
435
613
|
constructor(components: Components);
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
614
|
+
/**
|
|
615
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
616
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
617
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
618
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
619
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
620
|
+
* to make the location data available (e.g. absolute position of building).
|
|
621
|
+
*/
|
|
622
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
623
|
+
}
|
|
624
|
+
import * as WEBIFC from "web-ifc";
|
|
625
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
626
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
627
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
628
|
+
/**
|
|
629
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
630
|
+
*/
|
|
631
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
632
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
633
|
+
/** {@link Disposable.onDisposed} */
|
|
634
|
+
readonly onDisposed: Event<string>;
|
|
635
|
+
enabled: boolean;
|
|
636
|
+
readonly onRelationsIndexed: Event<{
|
|
637
|
+
modelID: string;
|
|
638
|
+
relationsMap: RelationsMap;
|
|
639
|
+
}>;
|
|
640
|
+
private _relToAttributesMap;
|
|
641
|
+
private _inverseAttributes;
|
|
642
|
+
private _ifcRels;
|
|
643
|
+
/**
|
|
644
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
645
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
646
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
647
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
648
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
649
|
+
* of entity relationships within a model.
|
|
650
|
+
*/
|
|
651
|
+
readonly relationMaps: ModelsRelationMap;
|
|
652
|
+
constructor(components: Components);
|
|
653
|
+
private onFragmentsDisposed;
|
|
654
|
+
private indexRelations;
|
|
655
|
+
/**
|
|
656
|
+
* Adds a relation map to the model's relations map.
|
|
657
|
+
*
|
|
658
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
659
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
660
|
+
*
|
|
661
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
662
|
+
*/
|
|
663
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
664
|
+
/**
|
|
665
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
666
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
667
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
668
|
+
*
|
|
669
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
670
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
671
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
672
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
673
|
+
* of entities that are related through that attribute.
|
|
674
|
+
*
|
|
675
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
676
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
677
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
678
|
+
* @throws An error if the model does not have properties loaded.
|
|
679
|
+
*/
|
|
680
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
681
|
+
/**
|
|
682
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
683
|
+
*
|
|
684
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
685
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
686
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
687
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
688
|
+
*/
|
|
689
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
690
|
+
/**
|
|
691
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
692
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
693
|
+
* returning the IDs of related entities if a match is found.
|
|
694
|
+
*
|
|
695
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
696
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
697
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
698
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
699
|
+
* or the specified relation name is not indexed.
|
|
700
|
+
*/
|
|
701
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
702
|
+
/**
|
|
703
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
704
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
705
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
706
|
+
* The resulting object is then serialized into a JSON string.
|
|
707
|
+
*
|
|
708
|
+
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
709
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
710
|
+
*/
|
|
711
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
712
|
+
/**
|
|
713
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
714
|
+
* This method iterates through the relations indexed for the given model,
|
|
715
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
716
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
717
|
+
* The resulting object is then serialized into a JSON string.
|
|
718
|
+
*
|
|
719
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
720
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
721
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
722
|
+
*/
|
|
723
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
724
|
+
/**
|
|
725
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
726
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
727
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
728
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
729
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
730
|
+
*
|
|
731
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
732
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
733
|
+
*/
|
|
734
|
+
serializeAllRelations(): string;
|
|
735
|
+
/**
|
|
736
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
737
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
738
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
739
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
740
|
+
* of express IDs of entities related through that relation type.
|
|
741
|
+
*
|
|
742
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
743
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
744
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
745
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
746
|
+
*/
|
|
747
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
748
|
+
/**
|
|
749
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
750
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
751
|
+
* references that could prevent garbage collection.
|
|
752
|
+
*/
|
|
753
|
+
dispose(): void;
|
|
754
|
+
}
|
|
755
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
756
|
+
import * as WEBIFC from "web-ifc";
|
|
757
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
758
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
759
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
760
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
761
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
762
|
+
interface ChangeMap {
|
|
763
|
+
[modelID: string]: Set<number>;
|
|
764
|
+
}
|
|
765
|
+
interface AttributeListener {
|
|
766
|
+
[modelID: string]: {
|
|
767
|
+
[expressID: number]: {
|
|
768
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
773
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
774
|
+
/** {@link Disposable.onDisposed} */
|
|
775
|
+
readonly onDisposed: Event<string>;
|
|
776
|
+
readonly onRequestFile: Event<unknown>;
|
|
777
|
+
ifcToExport: ArrayBuffer | null;
|
|
778
|
+
readonly onElementToPset: Event<{
|
|
779
|
+
model: FragmentsGroup;
|
|
780
|
+
psetID: number;
|
|
781
|
+
elementID: number;
|
|
782
|
+
}>;
|
|
783
|
+
readonly onPropToPset: Event<{
|
|
784
|
+
model: FragmentsGroup;
|
|
785
|
+
psetID: number;
|
|
786
|
+
propID: number;
|
|
787
|
+
}>;
|
|
788
|
+
readonly onPsetRemoved: Event<{
|
|
789
|
+
model: FragmentsGroup;
|
|
790
|
+
psetID: number;
|
|
791
|
+
}>;
|
|
792
|
+
readonly onDataChanged: Event<{
|
|
793
|
+
model: FragmentsGroup;
|
|
794
|
+
expressID: number;
|
|
795
|
+
}>;
|
|
796
|
+
wasm: {
|
|
797
|
+
path: string;
|
|
798
|
+
absolute: boolean;
|
|
799
|
+
};
|
|
800
|
+
enabled: boolean;
|
|
801
|
+
attributeListeners: AttributeListener;
|
|
802
|
+
selectedModel?: FragmentsGroup;
|
|
803
|
+
changeMap: ChangeMap;
|
|
804
|
+
constructor(components: Components);
|
|
805
|
+
dispose(): void;
|
|
806
|
+
private increaseMaxID;
|
|
807
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
808
|
+
private newGUID;
|
|
809
|
+
private getOwnerHistory;
|
|
810
|
+
private registerChange;
|
|
811
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
812
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
813
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
814
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
815
|
+
}>;
|
|
816
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
817
|
+
private newSingleProperty;
|
|
818
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
819
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
820
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
821
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
822
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
823
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
824
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
825
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
826
|
+
}
|
|
827
|
+
export {};
|
|
828
|
+
export declare class UUID {
|
|
829
|
+
private static _pattern;
|
|
830
|
+
private static _lut;
|
|
831
|
+
static create(): string;
|
|
832
|
+
static validate(uuid: string): void;
|
|
833
|
+
}
|
|
834
|
+
import * as THREE from "three";
|
|
835
|
+
import { Component, Components, Event, World } from "../core";
|
|
836
|
+
export interface VertexPickerConfig {
|
|
837
|
+
showOnlyVertex: boolean;
|
|
838
|
+
snapDistance: number;
|
|
839
|
+
previewElement: HTMLElement;
|
|
840
|
+
}
|
|
841
|
+
export declare class VertexPicker extends Component {
|
|
842
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
843
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
844
|
+
components: Components;
|
|
845
|
+
private _pickedPoint;
|
|
846
|
+
private _config;
|
|
847
|
+
private _enabled;
|
|
848
|
+
private _workingPlane;
|
|
849
|
+
set enabled(value: boolean);
|
|
850
|
+
get enabled(): boolean;
|
|
851
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
852
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
853
|
+
get workingPlane(): THREE.Plane | null;
|
|
854
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
855
|
+
get config(): Partial<VertexPickerConfig>;
|
|
856
|
+
dispose(): void;
|
|
857
|
+
get(world: World): THREE.Vector3 | null;
|
|
858
|
+
private getClosestVertex;
|
|
859
|
+
private getVertices;
|
|
860
|
+
private getVertex;
|
|
861
|
+
}
|
|
862
|
+
import * as WEBIFC from "web-ifc";
|
|
863
|
+
export interface IfcItemsCategories {
|
|
864
|
+
[itemID: number]: number;
|
|
865
|
+
}
|
|
866
|
+
export declare class IfcCategories {
|
|
867
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
868
|
+
}
|
|
869
|
+
export declare const IfcElements: {
|
|
870
|
+
[key: number]: string;
|
|
871
|
+
};
|
|
872
|
+
import * as THREE from "three";
|
|
873
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
874
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
875
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
876
|
+
/**
|
|
877
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
878
|
+
*/
|
|
879
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
880
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
881
|
+
/** {@link Component.enabled} */
|
|
882
|
+
enabled: boolean;
|
|
883
|
+
/** {@link Disposable.onDisposed} */
|
|
884
|
+
readonly onDisposed: Event<unknown>;
|
|
885
|
+
private _absoluteMin;
|
|
886
|
+
private _absoluteMax;
|
|
887
|
+
private _meshes;
|
|
888
|
+
constructor(components: Components);
|
|
889
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
890
|
+
width: number;
|
|
891
|
+
height: number;
|
|
892
|
+
depth: number;
|
|
893
|
+
center: THREE.Vector3;
|
|
894
|
+
};
|
|
895
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
896
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
897
|
+
/** {@link Disposable.dispose} */
|
|
898
|
+
dispose(): void;
|
|
446
899
|
get(): THREE.Box3;
|
|
447
900
|
getSphere(): THREE.Sphere;
|
|
448
901
|
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
@@ -451,6 +904,19 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
451
904
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
452
905
|
private static getFragmentBounds;
|
|
453
906
|
}
|
|
907
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
908
|
+
export declare class Exploder extends Component implements Disposable {
|
|
909
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
910
|
+
enabled: boolean;
|
|
911
|
+
height: number;
|
|
912
|
+
groupName: string;
|
|
913
|
+
/** {@link Disposable.onDisposed} */
|
|
914
|
+
readonly onDisposed: Event<unknown>;
|
|
915
|
+
list: Set<string>;
|
|
916
|
+
constructor(components: Components);
|
|
917
|
+
dispose(): void;
|
|
918
|
+
set(active: boolean): void;
|
|
919
|
+
}
|
|
454
920
|
import * as THREE from "three";
|
|
455
921
|
import * as FRAGS from "@thatopen/fragments";
|
|
456
922
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
@@ -485,25 +951,12 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
485
951
|
import * as FRAGS from "@thatopen/fragments";
|
|
486
952
|
import { Components, Component } from "../../core";
|
|
487
953
|
export declare class Hider extends Component {
|
|
488
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
489
|
-
enabled: boolean;
|
|
490
|
-
constructor(components: Components);
|
|
491
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
492
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
493
|
-
private updateCulledVisibility;
|
|
494
|
-
}
|
|
495
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
496
|
-
export declare class Exploder extends Component implements Disposable {
|
|
497
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
954
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
498
955
|
enabled: boolean;
|
|
499
|
-
height: number;
|
|
500
|
-
groupName: string;
|
|
501
|
-
/** {@link Disposable.onDisposed} */
|
|
502
|
-
readonly onDisposed: Event<unknown>;
|
|
503
|
-
list: Set<string>;
|
|
504
956
|
constructor(components: Components);
|
|
505
|
-
|
|
506
|
-
|
|
957
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
958
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
959
|
+
private updateCulledVisibility;
|
|
507
960
|
}
|
|
508
961
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
509
962
|
import * as THREE from "three";
|
|
@@ -511,8 +964,7 @@ import * as FRAGS from "@thatopen/fragments";
|
|
|
511
964
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
512
965
|
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
513
966
|
/**
|
|
514
|
-
* Object that can efficiently load binary files that contain
|
|
515
|
-
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
967
|
+
* Object that can efficiently load binary files that contain [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
516
968
|
*/
|
|
517
969
|
export declare class FragmentsManager extends Component implements Disposable {
|
|
518
970
|
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
@@ -556,6 +1008,27 @@ export declare class FragmentsManager extends Component implements Disposable {
|
|
|
556
1008
|
* @returns the exported data as binary buffer.
|
|
557
1009
|
*/
|
|
558
1010
|
export(group: FragmentsGroup): Uint8Array;
|
|
1011
|
+
/**
|
|
1012
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
1013
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1014
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1015
|
+
*/
|
|
1016
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
1017
|
+
[modelID: string]: Set<number>;
|
|
1018
|
+
};
|
|
1019
|
+
/**
|
|
1020
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
1021
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
1022
|
+
* @returns A fragment ID map.
|
|
1023
|
+
* @remarks
|
|
1024
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1025
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1026
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
1027
|
+
* If a model with a given ID is not found in the 'groups' map, the method skips that model and continues with the next one.
|
|
1028
|
+
*/
|
|
1029
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
1030
|
+
[modelID: string]: Set<number>;
|
|
1031
|
+
}): FRAGS.FragmentIdMap;
|
|
559
1032
|
coordinate(models?: FragmentsGroup[]): void;
|
|
560
1033
|
}
|
|
561
1034
|
import * as WEBIFC from "web-ifc";
|
|
@@ -621,325 +1094,113 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
621
1094
|
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
622
1095
|
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
623
1096
|
private readIfcFile;
|
|
624
|
-
private streamIfcFile;
|
|
625
|
-
private streamAllGeometries;
|
|
626
|
-
private cleanUp;
|
|
627
|
-
private getMesh;
|
|
628
|
-
private getGeometry;
|
|
629
|
-
private streamAssets;
|
|
630
|
-
private streamGeometries;
|
|
631
|
-
}
|
|
632
|
-
import * as THREE from "three";
|
|
633
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
634
|
-
center: THREE.Vector3;
|
|
635
|
-
halfSizes: THREE.Vector3;
|
|
636
|
-
rotation: THREE.Matrix3;
|
|
637
|
-
transformation: THREE.Matrix4;
|
|
638
|
-
};
|
|
639
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
640
|
-
import * as THREE from "three";
|
|
641
|
-
export declare class MaterialsUtils {
|
|
642
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
643
|
-
}
|
|
644
|
-
export declare class UUID {
|
|
645
|
-
private static _pattern;
|
|
646
|
-
private static _lut;
|
|
647
|
-
static create(): string;
|
|
648
|
-
static validate(uuid: string): void;
|
|
649
|
-
}
|
|
650
|
-
import * as THREE from "three";
|
|
651
|
-
import { Component, Components, Event, World } from "../core";
|
|
652
|
-
export interface VertexPickerConfig {
|
|
653
|
-
showOnlyVertex: boolean;
|
|
654
|
-
snapDistance: number;
|
|
655
|
-
previewElement: HTMLElement;
|
|
656
|
-
}
|
|
657
|
-
export declare class VertexPicker extends Component {
|
|
658
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
659
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
660
|
-
components: Components;
|
|
661
|
-
private _pickedPoint;
|
|
662
|
-
private _config;
|
|
663
|
-
private _enabled;
|
|
664
|
-
private _workingPlane;
|
|
665
|
-
set enabled(value: boolean);
|
|
666
|
-
get enabled(): boolean;
|
|
667
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
668
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
669
|
-
get workingPlane(): THREE.Plane | null;
|
|
670
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
671
|
-
get config(): Partial<VertexPickerConfig>;
|
|
672
|
-
dispose(): void;
|
|
673
|
-
get(world: World): THREE.Vector3 | null;
|
|
674
|
-
private getClosestVertex;
|
|
675
|
-
private getVertices;
|
|
676
|
-
private getVertex;
|
|
677
|
-
}
|
|
678
|
-
import * as WEBIFC from "web-ifc";
|
|
679
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
680
|
-
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
681
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
682
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
683
|
-
onPropertiesStreamed: AsyncEvent<{
|
|
684
|
-
type: number;
|
|
685
|
-
data: {
|
|
686
|
-
[id: number]: any;
|
|
687
|
-
};
|
|
688
|
-
}>;
|
|
689
|
-
onProgress: AsyncEvent<number>;
|
|
690
|
-
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
691
|
-
/** {@link Disposable.onDisposed} */
|
|
692
|
-
readonly onDisposed: Event<string>;
|
|
693
|
-
enabled: boolean;
|
|
694
|
-
settings: PropertiesStreamingSettings;
|
|
695
|
-
webIfc: WEBIFC.IfcAPI;
|
|
696
|
-
dispose(): Promise<void>;
|
|
697
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
698
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
699
|
-
private readIfcFile;
|
|
700
|
-
private streamIfcFile;
|
|
701
|
-
private streamAllProperties;
|
|
702
|
-
private cleanUp;
|
|
703
|
-
}
|
|
704
|
-
import * as WEBIFC from "web-ifc";
|
|
705
|
-
import * as FRAG from "@thatopen/fragments";
|
|
706
|
-
import { Component, Components } from "../../core";
|
|
707
|
-
/**
|
|
708
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
709
|
-
*/
|
|
710
|
-
export declare class IfcJsonExporter extends Component {
|
|
711
|
-
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
712
|
-
/** {@link Component.enabled} */
|
|
713
|
-
enabled: boolean;
|
|
714
|
-
constructor(components: Components);
|
|
715
|
-
/**
|
|
716
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
717
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
718
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
719
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
720
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
721
|
-
* to make the location data available (e.g. absolute position of building).
|
|
722
|
-
*/
|
|
723
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
724
|
-
}
|
|
725
|
-
import * as WEBIFC from "web-ifc";
|
|
726
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
727
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
728
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
729
|
-
/**
|
|
730
|
-
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
731
|
-
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
732
|
-
*/
|
|
733
|
-
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
734
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
735
|
-
/** {@link Disposable.onDisposed} */
|
|
736
|
-
readonly onDisposed: Event<string>;
|
|
737
|
-
enabled: boolean;
|
|
738
|
-
readonly onRelationsIndexed: Event<{
|
|
739
|
-
modelID: string;
|
|
740
|
-
relationsMap: RelationsMap;
|
|
741
|
-
}>;
|
|
742
|
-
private _relToAttributesMap;
|
|
743
|
-
private _inverseAttributes;
|
|
744
|
-
private _ifcRels;
|
|
745
|
-
/**
|
|
746
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
747
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
748
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
749
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
750
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
751
|
-
* of entity relationships within a model.
|
|
752
|
-
*/
|
|
753
|
-
readonly relationMaps: ModelsRelationMap;
|
|
754
|
-
constructor(components: Components);
|
|
755
|
-
private onFragmentsDisposed;
|
|
756
|
-
private indexRelations;
|
|
757
|
-
/**
|
|
758
|
-
* Adds a relation map to the model's relations map.
|
|
759
|
-
*
|
|
760
|
-
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
761
|
-
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
762
|
-
*
|
|
763
|
-
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
764
|
-
*/
|
|
765
|
-
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
766
|
-
/**
|
|
767
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
768
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
769
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
770
|
-
*
|
|
771
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
772
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
773
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
774
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
775
|
-
* of entities that are related through that attribute.
|
|
776
|
-
*
|
|
777
|
-
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
778
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
779
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
780
|
-
* @throws An error if the model does not have properties loaded.
|
|
781
|
-
*/
|
|
782
|
-
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
783
|
-
/**
|
|
784
|
-
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
785
|
-
*
|
|
786
|
-
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
787
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
788
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
789
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
790
|
-
*/
|
|
791
|
-
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
792
|
-
/**
|
|
793
|
-
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
794
|
-
* This method searches the indexed relation maps for the specified model and entity,
|
|
795
|
-
* returning the IDs of related entities if a match is found.
|
|
796
|
-
*
|
|
797
|
-
* @param model The 'FragmentsGroup' model containing the entity.
|
|
798
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
799
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
800
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
801
|
-
* or the specified relation name is not indexed.
|
|
802
|
-
*/
|
|
803
|
-
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
804
|
-
/**
|
|
805
|
-
* Serializes the relations of a given relation map into a JSON string.
|
|
806
|
-
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
807
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
808
|
-
* The resulting object is then serialized into a JSON string.
|
|
809
|
-
*
|
|
810
|
-
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
811
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
812
|
-
*/
|
|
813
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
814
|
-
/**
|
|
815
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
816
|
-
* This method iterates through the relations indexed for the given model,
|
|
817
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
818
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
819
|
-
* The resulting object is then serialized into a JSON string.
|
|
820
|
-
*
|
|
821
|
-
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
822
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
823
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
824
|
-
*/
|
|
825
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
826
|
-
/**
|
|
827
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
828
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
829
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
830
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
831
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
832
|
-
*
|
|
833
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
834
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
835
|
-
*/
|
|
836
|
-
serializeAllRelations(): string;
|
|
837
|
-
/**
|
|
838
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
839
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
840
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
841
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
842
|
-
* of express IDs of entities related through that relation type.
|
|
843
|
-
*
|
|
844
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
845
|
-
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
846
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
847
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
848
|
-
*/
|
|
849
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
850
|
-
/**
|
|
851
|
-
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
852
|
-
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
853
|
-
* references that could prevent garbage collection.
|
|
854
|
-
*/
|
|
855
|
-
dispose(): void;
|
|
856
|
-
}
|
|
857
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
858
|
-
import * as WEBIFC from "web-ifc";
|
|
859
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
860
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
861
|
-
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
862
|
-
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
863
|
-
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
864
|
-
interface ChangeMap {
|
|
865
|
-
[modelID: string]: Set<number>;
|
|
1097
|
+
private streamIfcFile;
|
|
1098
|
+
private streamAllGeometries;
|
|
1099
|
+
private cleanUp;
|
|
1100
|
+
private getMesh;
|
|
1101
|
+
private getGeometry;
|
|
1102
|
+
private streamAssets;
|
|
1103
|
+
private streamGeometries;
|
|
866
1104
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1105
|
+
import * as WEBIFC from "web-ifc";
|
|
1106
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1107
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
1108
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1109
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1110
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1111
|
+
type: number;
|
|
1112
|
+
data: {
|
|
1113
|
+
[id: number]: any;
|
|
871
1114
|
};
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1115
|
+
}>;
|
|
1116
|
+
onProgress: AsyncEvent<number>;
|
|
1117
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
876
1118
|
/** {@link Disposable.onDisposed} */
|
|
877
1119
|
readonly onDisposed: Event<string>;
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1120
|
+
enabled: boolean;
|
|
1121
|
+
settings: PropertiesStreamingSettings;
|
|
1122
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1123
|
+
dispose(): Promise<void>;
|
|
1124
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1125
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1126
|
+
private readIfcFile;
|
|
1127
|
+
private streamIfcFile;
|
|
1128
|
+
private streamAllProperties;
|
|
1129
|
+
private cleanUp;
|
|
1130
|
+
}
|
|
1131
|
+
export declare const IfcCategoryMap: {
|
|
1132
|
+
[key: number]: string;
|
|
1133
|
+
};
|
|
1134
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1135
|
+
export declare class IfcPropertiesUtils {
|
|
1136
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
1137
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
1138
|
+
[attribute: string]: any;
|
|
1139
|
+
} | null>;
|
|
1140
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
1141
|
+
[relatingID: number]: number[];
|
|
893
1142
|
}>;
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1143
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
1144
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
1145
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
1146
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
1147
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
1148
|
+
key: string | null;
|
|
1149
|
+
name: string | null;
|
|
897
1150
|
}>;
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
};
|
|
902
|
-
enabled: boolean;
|
|
903
|
-
attributeListeners: AttributeListener;
|
|
904
|
-
selectedModel?: FragmentsGroup;
|
|
905
|
-
changeMap: ChangeMap;
|
|
906
|
-
constructor(components: Components);
|
|
907
|
-
dispose(): void;
|
|
908
|
-
private increaseMaxID;
|
|
909
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
910
|
-
private newGUID;
|
|
911
|
-
private getOwnerHistory;
|
|
912
|
-
private registerChange;
|
|
913
|
-
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
914
|
-
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
915
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
916
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1151
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
1152
|
+
key: string | null;
|
|
1153
|
+
value: number | null;
|
|
917
1154
|
}>;
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
922
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
923
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
924
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
925
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
926
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
927
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
1155
|
+
static isRel(expressID: number): boolean;
|
|
1156
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
1157
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
928
1158
|
}
|
|
929
|
-
export
|
|
1159
|
+
export declare const GeometryTypes: Set<number>;
|
|
930
1160
|
import * as THREE from "three";
|
|
931
1161
|
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
1162
|
+
/**
|
|
1163
|
+
* A class representing a 2D minimap in a 3D world.
|
|
1164
|
+
*/
|
|
932
1165
|
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
933
1166
|
/** {@link Disposable.onDisposed} */
|
|
934
1167
|
readonly onDisposed: Event<unknown>;
|
|
1168
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
935
1169
|
readonly onAfterUpdate: Event<unknown>;
|
|
1170
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
936
1171
|
readonly onBeforeUpdate: Event<unknown>;
|
|
1172
|
+
/** {@link Resizeable.onResize} */
|
|
937
1173
|
readonly onResize: Event<THREE.Vector2>;
|
|
1174
|
+
/**
|
|
1175
|
+
* The front offset of the minimap.
|
|
1176
|
+
* It determines how much the minimap's view is offset from the camera's view.
|
|
1177
|
+
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
1178
|
+
*/
|
|
938
1179
|
frontOffset: number;
|
|
1180
|
+
/**
|
|
1181
|
+
* The override material for the minimap.
|
|
1182
|
+
* It is used to render the depth information of the world onto the minimap.
|
|
1183
|
+
*/
|
|
939
1184
|
overrideMaterial: THREE.MeshDepthMaterial;
|
|
1185
|
+
/**
|
|
1186
|
+
* The background color of the minimap.
|
|
1187
|
+
* It is used to set the background color of the minimap's renderer.
|
|
1188
|
+
*/
|
|
940
1189
|
backgroundColor: THREE.Color;
|
|
1190
|
+
/**
|
|
1191
|
+
* The WebGL renderer for the minimap.
|
|
1192
|
+
* It is used to render the minimap onto the screen.
|
|
1193
|
+
*/
|
|
941
1194
|
renderer: THREE.WebGLRenderer;
|
|
1195
|
+
/**
|
|
1196
|
+
* A flag indicating whether the minimap is enabled.
|
|
1197
|
+
* If disabled, the minimap will not update or render.
|
|
1198
|
+
*/
|
|
942
1199
|
enabled: boolean;
|
|
1200
|
+
/**
|
|
1201
|
+
* The world in which the minimap is displayed.
|
|
1202
|
+
* It provides access to the 3D scene, camera, and other relevant world elements.
|
|
1203
|
+
*/
|
|
943
1204
|
world: World;
|
|
944
1205
|
private _lockRotation;
|
|
945
1206
|
private _camera;
|
|
@@ -949,19 +1210,47 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
949
1210
|
private _tempVector2;
|
|
950
1211
|
private _tempTarget;
|
|
951
1212
|
private readonly down;
|
|
1213
|
+
/**
|
|
1214
|
+
* Gets or sets whether the minimap rotation is locked.
|
|
1215
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
1216
|
+
*/
|
|
952
1217
|
get lockRotation(): boolean;
|
|
1218
|
+
/**
|
|
1219
|
+
* Sets whether the minimap rotation is locked.
|
|
1220
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
1221
|
+
* @param active - If 'true', rotation is locked. If 'false', rotation is not locked.
|
|
1222
|
+
*/
|
|
953
1223
|
set lockRotation(active: boolean);
|
|
1224
|
+
/**
|
|
1225
|
+
* Gets the current zoom level of the minimap.
|
|
1226
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
1227
|
+
* @returns The current zoom level of the minimap.
|
|
1228
|
+
*/
|
|
954
1229
|
get zoom(): number;
|
|
1230
|
+
/**
|
|
1231
|
+
* Sets the zoom level of the minimap.
|
|
1232
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
1233
|
+
* @param value - The new zoom level of the minimap.
|
|
1234
|
+
*/
|
|
955
1235
|
set zoom(value: number);
|
|
956
1236
|
constructor(world: World);
|
|
1237
|
+
/** {@link Disposable.dispose} */
|
|
957
1238
|
dispose(): void;
|
|
1239
|
+
/** Returns the camera used by the MiniMap */
|
|
958
1240
|
get(): THREE.OrthographicCamera;
|
|
1241
|
+
/** {@link Updateable.update} */
|
|
959
1242
|
update(): void;
|
|
1243
|
+
/** {@link Resizeable.getSize} */
|
|
960
1244
|
getSize(): THREE.Vector2;
|
|
1245
|
+
/** {@link Resizeable.resize} */
|
|
961
1246
|
resize(size?: THREE.Vector2): void;
|
|
962
1247
|
private updatePlanes;
|
|
963
1248
|
}
|
|
964
|
-
|
|
1249
|
+
import { InverseAttribute } from "./types";
|
|
1250
|
+
export declare const relToAttributesMap: Map<number, {
|
|
1251
|
+
forRelating: InverseAttribute;
|
|
1252
|
+
forRelated: InverseAttribute;
|
|
1253
|
+
}>;
|
|
965
1254
|
import * as WEBIFC from "web-ifc";
|
|
966
1255
|
import { IfcItemsCategories } from "../../../ifc";
|
|
967
1256
|
export declare class SpatialStructure {
|
|
@@ -970,52 +1259,8 @@ export declare class SpatialStructure {
|
|
|
970
1259
|
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
971
1260
|
cleanUp(): void;
|
|
972
1261
|
}
|
|
973
|
-
import * as WEBIFC from "web-ifc";
|
|
974
|
-
export interface IfcItemsCategories {
|
|
975
|
-
[itemID: number]: number;
|
|
976
|
-
}
|
|
977
|
-
export declare class IfcCategories {
|
|
978
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
979
|
-
}
|
|
980
|
-
export declare const IfcElements: {
|
|
981
|
-
[key: number]: string;
|
|
982
|
-
};
|
|
983
|
-
export declare const IfcCategoryMap: {
|
|
984
|
-
[key: number]: string;
|
|
985
|
-
};
|
|
986
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
987
|
-
export declare class IfcPropertiesUtils {
|
|
988
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
989
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
990
|
-
[attribute: string]: any;
|
|
991
|
-
} | null>;
|
|
992
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
993
|
-
[relatingID: number]: number[];
|
|
994
|
-
}>;
|
|
995
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
996
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
997
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
998
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
999
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
1000
|
-
key: string | null;
|
|
1001
|
-
name: string | null;
|
|
1002
|
-
}>;
|
|
1003
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
1004
|
-
key: string | null;
|
|
1005
|
-
value: number | null;
|
|
1006
|
-
}>;
|
|
1007
|
-
static isRel(expressID: number): boolean;
|
|
1008
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
1009
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
1010
|
-
}
|
|
1011
1262
|
/**
|
|
1012
|
-
* Simple event handler by
|
|
1013
|
-
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1014
|
-
* Keep in mind that:
|
|
1015
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
1016
|
-
* an object.
|
|
1017
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1018
|
-
* the callback as an arrow function.
|
|
1263
|
+
* 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.
|
|
1019
1264
|
*/
|
|
1020
1265
|
export declare class Event<T> {
|
|
1021
1266
|
/**
|
|
@@ -1043,13 +1288,7 @@ export declare class Event<T> {
|
|
|
1043
1288
|
private handlers;
|
|
1044
1289
|
}
|
|
1045
1290
|
/**
|
|
1046
|
-
* Simple event handler by
|
|
1047
|
-
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
1048
|
-
* Keep in mind that:
|
|
1049
|
-
* - If you want to remove it later, you might want to declare the callback as
|
|
1050
|
-
* an object.
|
|
1051
|
-
* - If you want to maintain the reference to 'this', you will need to declare
|
|
1052
|
-
* the callback as an arrow function.
|
|
1291
|
+
* 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.
|
|
1053
1292
|
*/
|
|
1054
1293
|
export declare class AsyncEvent<T> {
|
|
1055
1294
|
/**
|
|
@@ -1076,32 +1315,11 @@ export declare class AsyncEvent<T> {
|
|
|
1076
1315
|
reset(): void;
|
|
1077
1316
|
private handlers;
|
|
1078
1317
|
}
|
|
1079
|
-
import { Base } from "./base";
|
|
1080
|
-
import { World } from "./world";
|
|
1081
|
-
import { Event } from "./event";
|
|
1082
|
-
import { Components } from "../../Components";
|
|
1083
|
-
/**
|
|
1084
|
-
* One of the elements that make a world. It can be either a scene, a camera
|
|
1085
|
-
* or a renderer.
|
|
1086
|
-
*/
|
|
1087
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
1088
|
-
readonly worlds: Map<string, World>;
|
|
1089
|
-
readonly onWorldChanged: Event<{
|
|
1090
|
-
world: World;
|
|
1091
|
-
action: "added" | "removed";
|
|
1092
|
-
}>;
|
|
1093
|
-
currentWorld: World | null;
|
|
1094
|
-
protected constructor(components: Components);
|
|
1095
|
-
}
|
|
1096
1318
|
import * as THREE from "three";
|
|
1097
1319
|
import CameraControls from "camera-controls";
|
|
1098
1320
|
import { Event } from "./event";
|
|
1099
1321
|
/**
|
|
1100
|
-
* Whether this component has to be manually destroyed once you are done with
|
|
1101
|
-
* it to prevent
|
|
1102
|
-
* [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1103
|
-
* This also ensures that the DOM events created by that component will be
|
|
1104
|
-
* cleaned up.
|
|
1322
|
+
* Whether this component has to be manually destroyed once you are done with it to prevent [memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects). This also ensures that the DOM events created by that component will be cleaned up.
|
|
1105
1323
|
*/
|
|
1106
1324
|
export interface Disposable {
|
|
1107
1325
|
/**
|
|
@@ -1109,13 +1327,11 @@ export interface Disposable {
|
|
|
1109
1327
|
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1110
1328
|
*/
|
|
1111
1329
|
dispose: () => void | Promise<void>;
|
|
1112
|
-
/** Fired after the tool has been
|
|
1330
|
+
/** Fired after the tool has been disposed. */
|
|
1113
1331
|
readonly onDisposed: Event<any>;
|
|
1114
1332
|
}
|
|
1115
1333
|
/**
|
|
1116
|
-
* Whether the geometric representation of this component can be
|
|
1117
|
-
* hidden or shown in the
|
|
1118
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1334
|
+
* Whether the geometric representation of this component can be hidden or shown in the [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
1119
1335
|
*/
|
|
1120
1336
|
export interface Hideable {
|
|
1121
1337
|
/**
|
|
@@ -1126,11 +1342,7 @@ export interface Hideable {
|
|
|
1126
1342
|
visible: boolean;
|
|
1127
1343
|
}
|
|
1128
1344
|
/**
|
|
1129
|
-
* Whether this component can be resized. The meaning of this can vary depending
|
|
1130
|
-
* on the component: resizing a
|
|
1131
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
1132
|
-
* component could mean changing its resolution, whereas resizing a
|
|
1133
|
-
* [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
1345
|
+
* Whether this component can be resized. The meaning of this can vary depending on the component: resizing a [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer) component could mean changing its resolution, whereas resizing a [Mesh](https://threejs.org/docs/#api/en/objects/Mesh) would change its scale.
|
|
1134
1346
|
*/
|
|
1135
1347
|
export interface Resizeable {
|
|
1136
1348
|
/**
|
|
@@ -1168,9 +1380,7 @@ export interface Progress {
|
|
|
1168
1380
|
total: number;
|
|
1169
1381
|
}
|
|
1170
1382
|
/**
|
|
1171
|
-
* Whether this component supports create and destroy operations. This generally
|
|
1172
|
-
* applies for components that work with instances, such as clipping planes or
|
|
1173
|
-
* dimensions.
|
|
1383
|
+
* Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
|
|
1174
1384
|
*/
|
|
1175
1385
|
export interface Createable {
|
|
1176
1386
|
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
@@ -1203,23 +1413,33 @@ export interface Configurable<T extends Record<string, any>> {
|
|
|
1203
1413
|
*/
|
|
1204
1414
|
config: Required<T>;
|
|
1205
1415
|
}
|
|
1206
|
-
/**
|
|
1207
|
-
* An interface to make [three-mesh-bvh](https://github.com/gkjohnson/three-mesh-bvh) compatible with typescript.
|
|
1208
|
-
*/
|
|
1209
|
-
export interface BVHGeometry extends THREE.BufferGeometry {
|
|
1210
|
-
boundsTree: Object | undefined;
|
|
1211
|
-
disposeBoundsTree: () => void;
|
|
1212
|
-
}
|
|
1213
1416
|
/**
|
|
1214
1417
|
* Whether a camera uses the Camera Controls library.
|
|
1215
1418
|
*/
|
|
1216
1419
|
export interface CameraControllable {
|
|
1420
|
+
/**
|
|
1421
|
+
* An instance of CameraControls that provides camera control functionalities.
|
|
1422
|
+
* This instance is used to manipulate the camera.
|
|
1423
|
+
*/
|
|
1217
1424
|
controls: CameraControls;
|
|
1218
1425
|
}
|
|
1426
|
+
import { Base } from "./base";
|
|
1427
|
+
/**
|
|
1428
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
1429
|
+
*/
|
|
1430
|
+
export declare abstract class Component extends Base {
|
|
1431
|
+
/**
|
|
1432
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1433
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1434
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1435
|
+
* will not be updated automatically each frame.
|
|
1436
|
+
*/
|
|
1437
|
+
abstract enabled: boolean;
|
|
1438
|
+
}
|
|
1219
1439
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1220
1440
|
import { Components } from "../../Components";
|
|
1221
1441
|
/**
|
|
1222
|
-
* Base class of the library. Useful for finding out the interfaces
|
|
1442
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
1223
1443
|
*/
|
|
1224
1444
|
export declare abstract class Base {
|
|
1225
1445
|
components: Components;
|
|
@@ -1235,38 +1455,55 @@ export declare abstract class Base {
|
|
|
1235
1455
|
/** Whether is component is {@link Configurable}. */
|
|
1236
1456
|
isConfigurable: () => this is Configurable<any>;
|
|
1237
1457
|
}
|
|
1238
|
-
import { InverseAttribute } from "./types";
|
|
1239
|
-
export declare const relToAttributesMap: Map<number, {
|
|
1240
|
-
forRelating: InverseAttribute;
|
|
1241
|
-
forRelated: InverseAttribute;
|
|
1242
|
-
}>;
|
|
1243
1458
|
import { Base } from "./base";
|
|
1459
|
+
import { World } from "./world";
|
|
1460
|
+
import { Event } from "./event";
|
|
1461
|
+
import { Components } from "../../Components";
|
|
1244
1462
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1247
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1248
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1249
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1250
|
-
* instance.
|
|
1463
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
1251
1464
|
*/
|
|
1252
|
-
export declare abstract class
|
|
1465
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1466
|
+
readonly worlds: Map<string, World>;
|
|
1253
1467
|
/**
|
|
1254
|
-
*
|
|
1255
|
-
*
|
|
1256
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1257
|
-
* will not be updated automatically each frame.
|
|
1468
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
1469
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
1258
1470
|
*/
|
|
1259
|
-
|
|
1471
|
+
readonly onWorldChanged: Event<{
|
|
1472
|
+
world: World;
|
|
1473
|
+
action: "added" | "removed";
|
|
1474
|
+
}>;
|
|
1475
|
+
/**
|
|
1476
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
1477
|
+
*/
|
|
1478
|
+
currentWorld: World | null;
|
|
1479
|
+
protected constructor(components: Components);
|
|
1260
1480
|
}
|
|
1261
1481
|
import * as THREE from "three";
|
|
1262
1482
|
import CameraControls from "camera-controls";
|
|
1263
1483
|
import { BaseWorldItem } from "./base-world-item";
|
|
1264
1484
|
import { CameraControllable } from "./interfaces";
|
|
1485
|
+
/**
|
|
1486
|
+
* Abstract class representing a camera in the 3D world. All cameras should use this class as a base.
|
|
1487
|
+
*/
|
|
1265
1488
|
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1489
|
+
/**
|
|
1490
|
+
* Whether the camera is enabled or not.
|
|
1491
|
+
*/
|
|
1266
1492
|
abstract enabled: boolean;
|
|
1493
|
+
/**
|
|
1494
|
+
* The Three.js camera instance.
|
|
1495
|
+
*/
|
|
1267
1496
|
abstract three: THREE.Camera;
|
|
1497
|
+
/**
|
|
1498
|
+
* Optional CameraControls instance for controlling the camera.
|
|
1499
|
+
* This property is only available if the camera is controllable.
|
|
1500
|
+
*/
|
|
1268
1501
|
abstract controls?: CameraControls;
|
|
1269
|
-
/**
|
|
1502
|
+
/**
|
|
1503
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
1504
|
+
*
|
|
1505
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
1506
|
+
*/
|
|
1270
1507
|
hasCameraControls: () => this is CameraControllable;
|
|
1271
1508
|
}
|
|
1272
1509
|
import * as THREE from "three";
|
|
@@ -1274,7 +1511,16 @@ import { Vector2 } from "three";
|
|
|
1274
1511
|
import { Event } from "./event";
|
|
1275
1512
|
import { BaseWorldItem } from "./base-world-item";
|
|
1276
1513
|
import { Disposable, Resizeable, Updateable } from "./interfaces";
|
|
1514
|
+
/**
|
|
1515
|
+
* Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
|
|
1516
|
+
*/
|
|
1277
1517
|
export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
|
|
1518
|
+
/**
|
|
1519
|
+
* The three.js WebGLRenderer instance associated with this renderer.
|
|
1520
|
+
*
|
|
1521
|
+
* @abstract
|
|
1522
|
+
* @type {THREE.WebGLRenderer}
|
|
1523
|
+
*/
|
|
1278
1524
|
abstract three: THREE.WebGLRenderer;
|
|
1279
1525
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1280
1526
|
onAfterUpdate: Event<unknown>;
|
|
@@ -1282,31 +1528,47 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1282
1528
|
onBeforeUpdate: Event<unknown>;
|
|
1283
1529
|
/** {@link Disposable.onDisposed} */
|
|
1284
1530
|
readonly onDisposed: Event<undefined>;
|
|
1531
|
+
/** {@link Resizeable.onResize} */
|
|
1285
1532
|
readonly onResize: Event<THREE.Vector2>;
|
|
1286
1533
|
/**
|
|
1287
1534
|
* Event that fires when there has been a change to the list of clipping
|
|
1288
1535
|
* planes used by the active renderer.
|
|
1289
1536
|
*/
|
|
1290
1537
|
readonly onClippingPlanesUpdated: Event<unknown>;
|
|
1538
|
+
/** {@link Updateable.update} */
|
|
1291
1539
|
abstract update(delta?: number): void | Promise<void>;
|
|
1540
|
+
/** {@link Disposable.dispose} */
|
|
1292
1541
|
abstract dispose(): void;
|
|
1542
|
+
/** {@link Resizeable.getSize} */
|
|
1293
1543
|
abstract getSize(): Vector2;
|
|
1544
|
+
/** {@link Resizeable.resize} */
|
|
1294
1545
|
abstract resize(size: Vector2 | undefined): void;
|
|
1295
1546
|
/**
|
|
1296
|
-
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
|
|
1297
|
-
* instance of the renderer.
|
|
1547
|
+
* The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
|
|
1298
1548
|
*/
|
|
1299
1549
|
clippingPlanes: THREE.Plane[];
|
|
1300
1550
|
/**
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1551
|
+
* Updates the clipping planes and triggers the 'onClippingPlanesUpdated' event.
|
|
1552
|
+
*
|
|
1553
|
+
* @remarks
|
|
1554
|
+
* This method is typically called when there is a change to the list of clipping planes
|
|
1555
|
+
* used by the active renderer.
|
|
1556
|
+
*/
|
|
1304
1557
|
updateClippingPlanes(): void;
|
|
1305
1558
|
/**
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1559
|
+
* Sets or removes a clipping plane from the renderer.
|
|
1560
|
+
*
|
|
1561
|
+
* @param active - A boolean indicating whether the clipping plane should be active or not.
|
|
1562
|
+
* @param plane - The clipping plane to be added or removed.
|
|
1563
|
+
* @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to 'false'.
|
|
1564
|
+
*
|
|
1565
|
+
* @remarks
|
|
1566
|
+
* This method adds or removes a clipping plane from the 'clippingPlanes' array.
|
|
1567
|
+
* If 'active' is 'true' and the plane is not already in the array, it is added.
|
|
1568
|
+
* If 'active' is 'false' and the plane is in the array, it is removed.
|
|
1569
|
+
* The 'three.clippingPlanes' property is then updated to reflect the current state of the 'clippingPlanes' array,
|
|
1570
|
+
* excluding any planes marked as local.
|
|
1571
|
+
*/
|
|
1310
1572
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1311
1573
|
}
|
|
1312
1574
|
import * as THREE from "three";
|
|
@@ -1314,9 +1576,16 @@ import { Disposable } from "./interfaces";
|
|
|
1314
1576
|
import { Event } from "./event";
|
|
1315
1577
|
import { Components } from "../../Components";
|
|
1316
1578
|
import { BaseWorldItem } from "./base-world-item";
|
|
1579
|
+
/**
|
|
1580
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
1581
|
+
*/
|
|
1317
1582
|
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1318
1583
|
/** {@link Disposable.onDisposed} */
|
|
1319
1584
|
readonly onDisposed: Event<unknown>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
1587
|
+
* It should be implemented by subclasses.
|
|
1588
|
+
*/
|
|
1320
1589
|
abstract three: THREE.Object3D;
|
|
1321
1590
|
protected constructor(components: Components);
|
|
1322
1591
|
/** {@link Disposable.dispose} */
|
|
@@ -1327,139 +1596,236 @@ import { BaseScene } from "./base-scene";
|
|
|
1327
1596
|
import { BaseCamera } from "./base-camera";
|
|
1328
1597
|
import { BaseRenderer } from "./base-renderer";
|
|
1329
1598
|
import { Updateable, Disposable } from "./interfaces";
|
|
1599
|
+
/**
|
|
1600
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
1601
|
+
*/
|
|
1330
1602
|
export interface World extends Disposable, Updateable {
|
|
1603
|
+
/**
|
|
1604
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
1605
|
+
*/
|
|
1331
1606
|
meshes: Set<THREE.Mesh>;
|
|
1607
|
+
/**
|
|
1608
|
+
* The base scene of the world.
|
|
1609
|
+
*/
|
|
1332
1610
|
scene: BaseScene;
|
|
1611
|
+
/**
|
|
1612
|
+
* The base camera of the world.
|
|
1613
|
+
*/
|
|
1333
1614
|
camera: BaseCamera;
|
|
1615
|
+
/**
|
|
1616
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
1617
|
+
*/
|
|
1334
1618
|
renderer: BaseRenderer | null;
|
|
1619
|
+
/**
|
|
1620
|
+
* A unique identifier for the world.
|
|
1621
|
+
*/
|
|
1335
1622
|
uuid: string;
|
|
1623
|
+
/**
|
|
1624
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
1625
|
+
*/
|
|
1336
1626
|
isDisposing: boolean;
|
|
1337
1627
|
}
|
|
1338
1628
|
import * as THREE from "three";
|
|
1339
|
-
import {
|
|
1629
|
+
import { Components } from "../../Components";
|
|
1630
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1340
1631
|
/**
|
|
1341
|
-
*
|
|
1342
|
-
* to work with tools like the
|
|
1343
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1344
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1632
|
+
* Interface for settings to configure the CullerRenderer.
|
|
1345
1633
|
*/
|
|
1346
|
-
export
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1634
|
+
export interface CullerRendererSettings {
|
|
1635
|
+
/**
|
|
1636
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
1637
|
+
* Default value is 1000.
|
|
1638
|
+
*/
|
|
1639
|
+
updateInterval?: number;
|
|
1640
|
+
/**
|
|
1641
|
+
* Width of the render target used for visibility checks.
|
|
1642
|
+
* Default value is 512.
|
|
1643
|
+
*/
|
|
1644
|
+
width?: number;
|
|
1645
|
+
/**
|
|
1646
|
+
* Height of the render target used for visibility checks.
|
|
1647
|
+
* Default value is 512.
|
|
1648
|
+
*/
|
|
1649
|
+
height?: number;
|
|
1650
|
+
/**
|
|
1651
|
+
* Whether the visibility check should be performed automatically.
|
|
1652
|
+
* Default value is true.
|
|
1653
|
+
*/
|
|
1654
|
+
autoUpdate?: boolean;
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* A base renderer to determine visibility on screen.
|
|
1658
|
+
*/
|
|
1659
|
+
export declare class CullerRenderer {
|
|
1350
1660
|
/** {@link Disposable.onDisposed} */
|
|
1351
|
-
readonly onDisposed: Event<
|
|
1352
|
-
constructor(dom: HTMLCanvasElement);
|
|
1661
|
+
readonly onDisposed: Event<string>;
|
|
1353
1662
|
/**
|
|
1354
|
-
*
|
|
1663
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1664
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1665
|
+
* just before but not anymore.
|
|
1355
1666
|
*/
|
|
1356
|
-
|
|
1667
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1668
|
+
/**
|
|
1669
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
1670
|
+
*/
|
|
1671
|
+
enabled: boolean;
|
|
1672
|
+
/**
|
|
1673
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1674
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1675
|
+
*/
|
|
1676
|
+
needsUpdate: boolean;
|
|
1677
|
+
/**
|
|
1678
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1679
|
+
* for debugging purposes.
|
|
1680
|
+
*/
|
|
1681
|
+
renderDebugFrame: boolean;
|
|
1682
|
+
/** The components instance to which this renderer belongs. */
|
|
1683
|
+
components: Components;
|
|
1684
|
+
/** The world instance to which this renderer belongs. */
|
|
1685
|
+
readonly world: World;
|
|
1686
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
1687
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1688
|
+
protected autoUpdate: boolean;
|
|
1689
|
+
protected updateInterval: number;
|
|
1690
|
+
protected readonly worker: Worker;
|
|
1691
|
+
protected readonly scene: THREE.Scene;
|
|
1692
|
+
private _width;
|
|
1693
|
+
private _height;
|
|
1694
|
+
private _availableColor;
|
|
1695
|
+
private readonly renderTarget;
|
|
1696
|
+
private readonly bufferSize;
|
|
1697
|
+
private readonly _buffer;
|
|
1698
|
+
protected _isWorkerBusy: boolean;
|
|
1699
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1357
1700
|
/** {@link Disposable.dispose} */
|
|
1358
1701
|
dispose(): void;
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1702
|
+
/**
|
|
1703
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1704
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1705
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1706
|
+
* not true.
|
|
1707
|
+
*/
|
|
1708
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1709
|
+
protected getAvailableColor(): {
|
|
1710
|
+
r: number;
|
|
1711
|
+
g: number;
|
|
1712
|
+
b: number;
|
|
1713
|
+
code: string;
|
|
1714
|
+
};
|
|
1715
|
+
protected increaseColor(): void;
|
|
1716
|
+
protected decreaseColor(): void;
|
|
1717
|
+
private applySettings;
|
|
1363
1718
|
}
|
|
1364
1719
|
import * as THREE from "three";
|
|
1720
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1365
1721
|
import { Components } from "../../Components";
|
|
1366
1722
|
import { Event, World, Disposable } from "../../Types";
|
|
1367
|
-
import { Mouse } from "./mouse";
|
|
1368
1723
|
/**
|
|
1369
|
-
* A
|
|
1370
|
-
* that allows to easily get items from the scene using the mouse and touch
|
|
1371
|
-
* events.
|
|
1724
|
+
* A renderer to determine a mesh visibility on screen.
|
|
1372
1725
|
*/
|
|
1373
|
-
export declare class
|
|
1374
|
-
/**
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
readonly
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1726
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
1727
|
+
/**
|
|
1728
|
+
* Event triggered when the visibility of meshes is updated.
|
|
1729
|
+
* Contains two sets: seen and unseen.
|
|
1730
|
+
*/
|
|
1731
|
+
readonly onViewUpdated: Event<{
|
|
1732
|
+
seen: Set<THREE.Mesh>;
|
|
1733
|
+
unseen: Set<THREE.Mesh>;
|
|
1734
|
+
}>;
|
|
1735
|
+
/**
|
|
1736
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
1737
|
+
* Default value is 100.
|
|
1738
|
+
*/
|
|
1739
|
+
threshold: number;
|
|
1740
|
+
/**
|
|
1741
|
+
* Map of color code to THREE.InstancedMesh.
|
|
1742
|
+
* Used to keep track of color-coded meshes.
|
|
1743
|
+
*/
|
|
1744
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Flag to indicate if the renderer is currently processing.
|
|
1747
|
+
* Used to prevent concurrent processing.
|
|
1748
|
+
*/
|
|
1749
|
+
isProcessing: boolean;
|
|
1750
|
+
private _colorCodeMeshMap;
|
|
1751
|
+
private _meshIDColorCodeMap;
|
|
1752
|
+
private _currentVisibleMeshes;
|
|
1753
|
+
private _recentlyHiddenMeshes;
|
|
1754
|
+
private _intervalID;
|
|
1755
|
+
private readonly _transparentMat;
|
|
1756
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1384
1757
|
/** {@link Disposable.dispose} */
|
|
1385
1758
|
dispose(): void;
|
|
1386
1759
|
/**
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
1391
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1392
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1393
|
-
* {@link Components.meshes}.
|
|
1760
|
+
* 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.
|
|
1761
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
1762
|
+
* @returns {void}
|
|
1394
1763
|
*/
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1764
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1765
|
+
/**
|
|
1766
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
1767
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
1768
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
1769
|
+
* @returns {void}
|
|
1770
|
+
*/
|
|
1771
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1772
|
+
private handleWorkerMessage;
|
|
1773
|
+
private getAvailableMaterial;
|
|
1399
1774
|
}
|
|
1400
|
-
|
|
1401
|
-
import
|
|
1402
|
-
|
|
1403
|
-
export declare class
|
|
1775
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1776
|
+
import * as WEBIFC from "web-ifc";
|
|
1777
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
1778
|
+
export declare class IfcFragmentSettings {
|
|
1779
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
1780
|
+
includeProperties: boolean;
|
|
1404
1781
|
/**
|
|
1405
|
-
*
|
|
1782
|
+
* Generate the geometry for categories that are not included by default,
|
|
1783
|
+
* like IFCSPACE.
|
|
1406
1784
|
*/
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
constructor(components: Components);
|
|
1425
|
-
update(delta?: number): void;
|
|
1426
|
-
dispose(disposeResources?: boolean): void;
|
|
1785
|
+
optionalCategories: number[];
|
|
1786
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
1787
|
+
coordinate: boolean;
|
|
1788
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1789
|
+
wasm: {
|
|
1790
|
+
path: string;
|
|
1791
|
+
absolute: boolean;
|
|
1792
|
+
logLevel?: WEBIFC.LogLevel;
|
|
1793
|
+
};
|
|
1794
|
+
/** List of categories that won't be converted to fragments. */
|
|
1795
|
+
excludedCategories: Set<number>;
|
|
1796
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
1797
|
+
saveLocations: boolean;
|
|
1798
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1799
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1800
|
+
autoSetWasm: boolean;
|
|
1801
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1427
1802
|
}
|
|
1428
1803
|
import * as THREE from "three";
|
|
1429
|
-
import
|
|
1430
|
-
import
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
update(): void;
|
|
1448
|
-
/** {@link Disposable.dispose} */
|
|
1449
|
-
dispose(): void;
|
|
1450
|
-
/** {@link Resizeable.getSize}. */
|
|
1451
|
-
getSize(): THREE.Vector2;
|
|
1452
|
-
/** {@link Resizeable.resize} */
|
|
1453
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1454
|
-
setupEvents(active: boolean): void;
|
|
1455
|
-
private resizeEvent;
|
|
1456
|
-
private setupRenderer;
|
|
1457
|
-
private onContextLost;
|
|
1458
|
-
private onContextBack;
|
|
1804
|
+
import * as WEBIFC from "web-ifc";
|
|
1805
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1806
|
+
export declare class CivilReader {
|
|
1807
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1808
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1809
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1810
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1811
|
+
} | undefined;
|
|
1812
|
+
get(civilItems: any): {
|
|
1813
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1814
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1815
|
+
} | undefined;
|
|
1816
|
+
private getCurves;
|
|
1817
|
+
}
|
|
1818
|
+
import * as WEBIFC from "web-ifc";
|
|
1819
|
+
export declare class IfcMetadataReader {
|
|
1820
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1821
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1459
1822
|
}
|
|
1460
1823
|
import * as THREE from "three";
|
|
1461
1824
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1462
1825
|
import { Components } from "../../Components";
|
|
1826
|
+
/**
|
|
1827
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
1828
|
+
*/
|
|
1463
1829
|
export interface SimpleSceneConfig {
|
|
1464
1830
|
directionalLight: {
|
|
1465
1831
|
color: THREE.Color;
|
|
@@ -1472,39 +1838,129 @@ export interface SimpleSceneConfig {
|
|
|
1472
1838
|
};
|
|
1473
1839
|
}
|
|
1474
1840
|
/**
|
|
1475
|
-
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1476
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1477
|
-
* @noInheritDoc
|
|
1841
|
+
* 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.
|
|
1478
1842
|
*/
|
|
1479
1843
|
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1480
1844
|
/** {@link Configurable.isSetup} */
|
|
1481
1845
|
isSetup: boolean;
|
|
1846
|
+
/**
|
|
1847
|
+
* The underlying Three.js scene object.
|
|
1848
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
1849
|
+
*/
|
|
1482
1850
|
three: THREE.Scene;
|
|
1483
1851
|
/** {@link Configurable.onSetup} */
|
|
1484
1852
|
readonly onSetup: Event<SimpleScene>;
|
|
1853
|
+
/**
|
|
1854
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
1855
|
+
* Defines properties for directional and ambient lights.
|
|
1856
|
+
*/
|
|
1485
1857
|
config: Required<SimpleSceneConfig>;
|
|
1486
1858
|
constructor(components: Components);
|
|
1487
|
-
/**
|
|
1859
|
+
/** {@link Configurable.setup} */
|
|
1488
1860
|
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1489
1861
|
}
|
|
1490
1862
|
import * as THREE from "three";
|
|
1863
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
1864
|
+
/**
|
|
1865
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
1866
|
+
*
|
|
1867
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
1868
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
1869
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
1870
|
+
*/
|
|
1871
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
1872
|
+
/**
|
|
1873
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
1874
|
+
*/
|
|
1875
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1876
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1877
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1878
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1879
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1880
|
+
/** {@link Disposable.onDisposed} */
|
|
1881
|
+
readonly onDisposed: Event<unknown>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Indicates whether the world is currently being disposed. This is useful to prevent trying to access world's elements when it's being disposed, which could cause errors when you dispose a world.
|
|
1884
|
+
*/
|
|
1885
|
+
isDisposing: boolean;
|
|
1886
|
+
/**
|
|
1887
|
+
* Indicates whether the world is currently enabled.
|
|
1888
|
+
* When disabled, the world will not be updated.
|
|
1889
|
+
*/
|
|
1890
|
+
enabled: boolean;
|
|
1891
|
+
/**
|
|
1892
|
+
* A unique identifier for the world.
|
|
1893
|
+
*/
|
|
1894
|
+
uuid: string;
|
|
1895
|
+
/**
|
|
1896
|
+
* An optional name for the world.
|
|
1897
|
+
*/
|
|
1898
|
+
name?: string;
|
|
1899
|
+
private _scene?;
|
|
1900
|
+
private _camera?;
|
|
1901
|
+
private _renderer;
|
|
1902
|
+
/**
|
|
1903
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
1904
|
+
* @returns The current scene.
|
|
1905
|
+
*/
|
|
1906
|
+
get scene(): T;
|
|
1907
|
+
/**
|
|
1908
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
1909
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
1910
|
+
* @param scene - The new scene to be set.
|
|
1911
|
+
*/
|
|
1912
|
+
set scene(scene: T);
|
|
1913
|
+
/**
|
|
1914
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
1915
|
+
* @returns The current camera.
|
|
1916
|
+
*/
|
|
1917
|
+
get camera(): U;
|
|
1918
|
+
/**
|
|
1919
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
1920
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
1921
|
+
* @param camera - The new camera to be set.
|
|
1922
|
+
*/
|
|
1923
|
+
set camera(camera: U);
|
|
1924
|
+
/**
|
|
1925
|
+
* Getter for the renderer.
|
|
1926
|
+
* @returns The current renderer or null if no renderer is set. Some worlds don't need a renderer to work (when your mail goal is not to display a 3D viewport to the user).
|
|
1927
|
+
*/
|
|
1928
|
+
get renderer(): S | null;
|
|
1929
|
+
/**
|
|
1930
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
1931
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
1932
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
1933
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
1934
|
+
*/
|
|
1935
|
+
set renderer(renderer: S | null);
|
|
1936
|
+
/** {@link Updateable.update} */
|
|
1937
|
+
update(delta?: number): void;
|
|
1938
|
+
/** {@link Disposable.dispose} */
|
|
1939
|
+
dispose(disposeResources?: boolean): void;
|
|
1940
|
+
}
|
|
1941
|
+
import * as THREE from "three";
|
|
1491
1942
|
import CameraControls from "camera-controls";
|
|
1492
1943
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1493
1944
|
import { Components } from "../../Components";
|
|
1494
1945
|
/**
|
|
1495
|
-
* A basic camera that uses
|
|
1496
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1497
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1498
|
-
* what features it offers.
|
|
1946
|
+
* A basic camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to easily control the camera in 2D and 3D. Check out it's API to find out what features it offers.
|
|
1499
1947
|
*/
|
|
1500
1948
|
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1501
1949
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1502
1950
|
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1503
1951
|
/** {@link Updateable.onAfterUpdate} */
|
|
1504
1952
|
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1953
|
+
/**
|
|
1954
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
1955
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
1956
|
+
*/
|
|
1505
1957
|
readonly onAspectUpdated: Event<unknown>;
|
|
1506
1958
|
/** {@link Disposable.onDisposed} */
|
|
1507
1959
|
readonly onDisposed: Event<string>;
|
|
1960
|
+
/**
|
|
1961
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
1962
|
+
* This camera is used for rendering the scene.
|
|
1963
|
+
*/
|
|
1508
1964
|
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1509
1965
|
private _allControls;
|
|
1510
1966
|
/**
|
|
@@ -1514,9 +1970,20 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1514
1970
|
* object to move, rotate, look at objects, etc.
|
|
1515
1971
|
*/
|
|
1516
1972
|
get controls(): CameraControls;
|
|
1517
|
-
/**
|
|
1973
|
+
/**
|
|
1974
|
+
* Getter for the enabled state of the camera controls.
|
|
1975
|
+
* If the current world is null, it returns false.
|
|
1976
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
1977
|
+
*
|
|
1978
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
1979
|
+
*/
|
|
1518
1980
|
get enabled(): boolean;
|
|
1519
|
-
/**
|
|
1981
|
+
/**
|
|
1982
|
+
* Setter for the enabled state of the camera controls.
|
|
1983
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
1984
|
+
*
|
|
1985
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
1986
|
+
*/
|
|
1520
1987
|
set enabled(enabled: boolean);
|
|
1521
1988
|
constructor(components: Components);
|
|
1522
1989
|
/** {@link Disposable.dispose} */
|
|
@@ -1534,202 +2001,111 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1534
2001
|
private static getSubsetOfThree;
|
|
1535
2002
|
}
|
|
1536
2003
|
import * as THREE from "three";
|
|
1537
|
-
import {
|
|
2004
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1538
2005
|
import { Components } from "../../Components";
|
|
1539
|
-
export interface GridConfig {
|
|
1540
|
-
color: THREE.Color;
|
|
1541
|
-
size1: number;
|
|
1542
|
-
size2: number;
|
|
1543
|
-
distance: number;
|
|
1544
|
-
}
|
|
1545
2006
|
/**
|
|
1546
|
-
*
|
|
1547
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1548
|
-
* and translated to typescript by
|
|
1549
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2007
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1550
2008
|
*/
|
|
1551
|
-
export declare class
|
|
1552
|
-
/** {@link Disposable.onDisposed} */
|
|
1553
|
-
readonly onDisposed: Event<unknown>;
|
|
1554
|
-
world: World;
|
|
1555
|
-
components: Components;
|
|
1556
|
-
/** {@link Hideable.visible} */
|
|
1557
|
-
get visible(): boolean;
|
|
1558
|
-
/** {@link Hideable.visible} */
|
|
1559
|
-
set visible(visible: boolean);
|
|
1560
|
-
/** The material of the grid. */
|
|
1561
|
-
get material(): THREE.ShaderMaterial;
|
|
1562
|
-
/**
|
|
1563
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1564
|
-
* perspective cameras and false for orthographic cameras.
|
|
1565
|
-
*/
|
|
1566
|
-
get fade(): boolean;
|
|
2009
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1567
2010
|
/**
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
2011
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
2012
|
+
* Default is 'true'.
|
|
1570
2013
|
*/
|
|
1571
|
-
|
|
1572
|
-
readonly three: THREE.Mesh;
|
|
1573
|
-
private _fade;
|
|
1574
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
1575
|
-
/** {@link Disposable.dispose} */
|
|
1576
|
-
dispose(): void;
|
|
1577
|
-
private setupEvents;
|
|
1578
|
-
private updateZoom;
|
|
1579
|
-
}
|
|
1580
|
-
import * as THREE from "three";
|
|
1581
|
-
import { Components } from "../../Components";
|
|
1582
|
-
import { AsyncEvent, Event, World } from "../../Types";
|
|
1583
|
-
export interface CullerRendererSettings {
|
|
1584
|
-
updateInterval?: number;
|
|
1585
|
-
width?: number;
|
|
1586
|
-
height?: number;
|
|
1587
|
-
autoUpdate?: boolean;
|
|
1588
|
-
}
|
|
1589
|
-
/**
|
|
1590
|
-
* A base renderer to determine visibility on screen
|
|
1591
|
-
*/
|
|
1592
|
-
export declare class CullerRenderer {
|
|
1593
|
-
/** {@link Disposable.onDisposed} */
|
|
1594
|
-
readonly onDisposed: Event<string>;
|
|
2014
|
+
enabled: boolean;
|
|
1595
2015
|
/**
|
|
1596
|
-
*
|
|
1597
|
-
* meshes that are currently visible, and the ones that were visible
|
|
1598
|
-
* just before but not anymore.
|
|
2016
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
1599
2017
|
*/
|
|
1600
|
-
|
|
1601
|
-
/** {@link Component.enabled} */
|
|
1602
|
-
enabled: boolean;
|
|
2018
|
+
container: HTMLElement;
|
|
1603
2019
|
/**
|
|
1604
|
-
*
|
|
1605
|
-
* You can bind this to the camera movement, to a certain interval, etc.
|
|
2020
|
+
* The THREE.js WebGLRenderer instance.
|
|
1606
2021
|
*/
|
|
1607
|
-
|
|
2022
|
+
three: THREE.WebGLRenderer;
|
|
2023
|
+
protected _canvas: HTMLCanvasElement;
|
|
2024
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
2025
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
2026
|
+
protected onContainerUpdated: Event<unknown>;
|
|
2027
|
+
private _resizing;
|
|
1608
2028
|
/**
|
|
1609
|
-
*
|
|
1610
|
-
*
|
|
2029
|
+
* Constructor for the SimpleRenderer class.
|
|
2030
|
+
*
|
|
2031
|
+
* @param components - The components instance.
|
|
2032
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
2033
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
1611
2034
|
*/
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
1616
|
-
protected autoUpdate: boolean;
|
|
1617
|
-
protected updateInterval: number;
|
|
1618
|
-
protected readonly worker: Worker;
|
|
1619
|
-
protected readonly scene: THREE.Scene;
|
|
1620
|
-
private _width;
|
|
1621
|
-
private _height;
|
|
1622
|
-
private _availableColor;
|
|
1623
|
-
private readonly renderTarget;
|
|
1624
|
-
private readonly bufferSize;
|
|
1625
|
-
private readonly _buffer;
|
|
1626
|
-
protected _isWorkerBusy: boolean;
|
|
1627
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2035
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
2036
|
+
/** {@link Updateable.update} */
|
|
2037
|
+
update(): void;
|
|
1628
2038
|
/** {@link Disposable.dispose} */
|
|
1629
2039
|
dispose(): void;
|
|
2040
|
+
/** {@link Resizeable.getSize}. */
|
|
2041
|
+
getSize(): THREE.Vector2;
|
|
2042
|
+
/** {@link Resizeable.resize} */
|
|
2043
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1630
2044
|
/**
|
|
1631
|
-
*
|
|
1632
|
-
*
|
|
1633
|
-
* @param
|
|
1634
|
-
*
|
|
2045
|
+
* Sets up and manages the event listeners for the renderer.
|
|
2046
|
+
*
|
|
2047
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
2048
|
+
*
|
|
2049
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
1635
2050
|
*/
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
code: string;
|
|
1642
|
-
};
|
|
1643
|
-
protected increaseColor(): void;
|
|
1644
|
-
protected decreaseColor(): void;
|
|
1645
|
-
private applySettings;
|
|
2051
|
+
setupEvents(active: boolean): void;
|
|
2052
|
+
private resizeEvent;
|
|
2053
|
+
private setupRenderer;
|
|
2054
|
+
private onContextLost;
|
|
2055
|
+
private onContextBack;
|
|
1646
2056
|
}
|
|
1647
2057
|
import * as THREE from "three";
|
|
1648
|
-
import {
|
|
1649
|
-
import { Components } from "../../Components";
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
threshold: number;
|
|
1656
|
-
readonly onViewUpdated: Event<{
|
|
1657
|
-
seen: Set<THREE.Mesh>;
|
|
1658
|
-
unseen: Set<THREE.Mesh>;
|
|
1659
|
-
}>;
|
|
1660
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1661
|
-
isProcessing: boolean;
|
|
1662
|
-
private _colorCodeMeshMap;
|
|
1663
|
-
private _meshIDColorCodeMap;
|
|
1664
|
-
private _currentVisibleMeshes;
|
|
1665
|
-
private _recentlyHiddenMeshes;
|
|
1666
|
-
private _intervalID;
|
|
1667
|
-
private readonly _transparentMat;
|
|
1668
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1669
|
-
dispose(): void;
|
|
1670
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1671
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1672
|
-
private handleWorkerMessage;
|
|
1673
|
-
private getAvailableMaterial;
|
|
1674
|
-
}
|
|
1675
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1676
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
1677
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1678
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1679
|
-
minGeometrySize: number;
|
|
1680
|
-
minAssetsSize: number;
|
|
1681
|
-
}
|
|
1682
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1683
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1684
|
-
propertiesSize: number;
|
|
1685
|
-
}
|
|
1686
|
-
import * as WEBIFC from "web-ifc";
|
|
1687
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1688
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1689
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1690
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1691
|
-
onPropertiesStreamed: AsyncEvent<{
|
|
1692
|
-
type: number;
|
|
1693
|
-
data: {
|
|
1694
|
-
[id: number]: any;
|
|
1695
|
-
};
|
|
1696
|
-
}>;
|
|
1697
|
-
onProgress: AsyncEvent<number>;
|
|
1698
|
-
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1699
|
-
/** {@link Disposable.onDisposed} */
|
|
1700
|
-
readonly onDisposed: Event<string>;
|
|
1701
|
-
enabled: boolean;
|
|
1702
|
-
settings: PropertiesStreamingSettings;
|
|
1703
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1704
|
-
dispose(): Promise<void>;
|
|
1705
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1706
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1707
|
-
private readIfcFile;
|
|
1708
|
-
private streamIfcFile;
|
|
1709
|
-
private streamAllProperties;
|
|
1710
|
-
private getIndices;
|
|
1711
|
-
private cleanUp;
|
|
1712
|
-
}
|
|
1713
|
-
export interface StreamedGeometries {
|
|
1714
|
-
[id: number]: {
|
|
1715
|
-
boundingBox: Float32Array;
|
|
1716
|
-
hasHoles: boolean;
|
|
1717
|
-
geometryFile?: string;
|
|
1718
|
-
};
|
|
2058
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2059
|
+
import { Components } from "../../Components";
|
|
2060
|
+
export interface GridConfig {
|
|
2061
|
+
color: THREE.Color;
|
|
2062
|
+
size1: number;
|
|
2063
|
+
size2: number;
|
|
2064
|
+
distance: number;
|
|
1719
2065
|
}
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
2066
|
+
/**
|
|
2067
|
+
* An infinite grid. Created by
|
|
2068
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
2069
|
+
* and translated to typescript by
|
|
2070
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2071
|
+
*/
|
|
2072
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2073
|
+
/** {@link Disposable.onDisposed} */
|
|
2074
|
+
readonly onDisposed: Event<unknown>;
|
|
2075
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2076
|
+
world: World;
|
|
2077
|
+
/** The components instance to which this grid belongs. */
|
|
2078
|
+
components: Components;
|
|
2079
|
+
/** {@link Hideable.visible} */
|
|
2080
|
+
get visible(): boolean;
|
|
2081
|
+
/** {@link Hideable.visible} */
|
|
2082
|
+
set visible(visible: boolean);
|
|
2083
|
+
/** The material of the grid. */
|
|
2084
|
+
get material(): THREE.ShaderMaterial;
|
|
2085
|
+
/**
|
|
2086
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2087
|
+
* perspective cameras and false for orthographic cameras.
|
|
2088
|
+
*/
|
|
2089
|
+
get fade(): boolean;
|
|
2090
|
+
/**
|
|
2091
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2092
|
+
* perspective cameras and false for orthographic cameras.
|
|
2093
|
+
*/
|
|
2094
|
+
set fade(active: boolean);
|
|
2095
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2096
|
+
readonly three: THREE.Mesh;
|
|
2097
|
+
private _fade;
|
|
2098
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2099
|
+
/** {@link Disposable.dispose} */
|
|
2100
|
+
dispose(): void;
|
|
2101
|
+
private setupEvents;
|
|
2102
|
+
private updateZoom;
|
|
1727
2103
|
}
|
|
1728
2104
|
import * as THREE from "three";
|
|
1729
2105
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1730
2106
|
import { Components } from "../../Components";
|
|
1731
2107
|
/**
|
|
1732
|
-
* Each of the planes created by
|
|
2108
|
+
* Each of the planes created by the clipper.
|
|
1733
2109
|
*/
|
|
1734
2110
|
export declare class SimplePlane implements Disposable, Hideable {
|
|
1735
2111
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
@@ -1738,21 +2114,40 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1738
2114
|
readonly onDraggingEnded: Event<unknown>;
|
|
1739
2115
|
/** {@link Disposable.onDisposed} */
|
|
1740
2116
|
readonly onDisposed: Event<unknown>;
|
|
2117
|
+
/**
|
|
2118
|
+
* The normal vector of the clipping plane.
|
|
2119
|
+
*/
|
|
1741
2120
|
readonly normal: THREE.Vector3;
|
|
2121
|
+
/**
|
|
2122
|
+
* The origin point of the clipping plane.
|
|
2123
|
+
*/
|
|
1742
2124
|
readonly origin: THREE.Vector3;
|
|
2125
|
+
/**
|
|
2126
|
+
* The THREE.js Plane object representing the clipping plane.
|
|
2127
|
+
*/
|
|
1743
2128
|
readonly three: THREE.Plane;
|
|
2129
|
+
/** The components instance to which this plane belongs. */
|
|
2130
|
+
components: Components;
|
|
2131
|
+
/** The world instance to which this plane belongs. */
|
|
2132
|
+
world: World;
|
|
1744
2133
|
protected readonly _helper: THREE.Object3D;
|
|
1745
2134
|
protected _visible: boolean;
|
|
1746
2135
|
protected _enabled: boolean;
|
|
1747
|
-
components: Components;
|
|
1748
|
-
world: World;
|
|
1749
2136
|
private _controlsActive;
|
|
1750
2137
|
private readonly _arrowBoundBox;
|
|
1751
2138
|
private readonly _planeMesh;
|
|
1752
2139
|
private readonly _controls;
|
|
1753
2140
|
private readonly _hiddenMaterial;
|
|
2141
|
+
/**
|
|
2142
|
+
* Getter for the enabled state of the clipping plane.
|
|
2143
|
+
* @returns {boolean} The current enabled state.
|
|
2144
|
+
*/
|
|
1754
2145
|
get enabled(): boolean;
|
|
1755
|
-
/**
|
|
2146
|
+
/**
|
|
2147
|
+
* Setter for the enabled state of the clipping plane.
|
|
2148
|
+
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
2149
|
+
* @param {boolean} state - The new enabled state.
|
|
2150
|
+
*/
|
|
1756
2151
|
set enabled(state: boolean);
|
|
1757
2152
|
/** {@link Hideable.visible } */
|
|
1758
2153
|
get visible(): boolean;
|
|
@@ -1768,8 +2163,25 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1768
2163
|
get size(): number;
|
|
1769
2164
|
/** Sets the size of the clipping plane representation. */
|
|
1770
2165
|
set size(size: number);
|
|
2166
|
+
/**
|
|
2167
|
+
* Getter for the helper object of the clipping plane.
|
|
2168
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
2169
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
2170
|
+
*
|
|
2171
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
2172
|
+
*/
|
|
1771
2173
|
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1772
2174
|
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
2175
|
+
/**
|
|
2176
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
2177
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
2178
|
+
* and positions the helper object accordingly.
|
|
2179
|
+
*
|
|
2180
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
2181
|
+
* @param point - The new origin point for the clipping plane.
|
|
2182
|
+
*
|
|
2183
|
+
* @returns {void}
|
|
2184
|
+
*/
|
|
1773
2185
|
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
1774
2186
|
/** {@link Updateable.update} */
|
|
1775
2187
|
update: () => void;
|
|
@@ -1786,58 +2198,62 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1786
2198
|
private newHelper;
|
|
1787
2199
|
private static newPlaneMesh;
|
|
1788
2200
|
}
|
|
1789
|
-
import
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
2201
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2202
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
2203
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
2204
|
+
minGeometrySize: number;
|
|
2205
|
+
minAssetsSize: number;
|
|
1793
2206
|
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
optionalCategories: number[];
|
|
1804
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
1805
|
-
coordinate: boolean;
|
|
1806
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1807
|
-
wasm: {
|
|
1808
|
-
path: string;
|
|
1809
|
-
absolute: boolean;
|
|
1810
|
-
logLevel?: WEBIFC.LogLevel;
|
|
2207
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
2208
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
2209
|
+
propertiesSize: number;
|
|
2210
|
+
}
|
|
2211
|
+
export interface StreamedGeometries {
|
|
2212
|
+
[id: number]: {
|
|
2213
|
+
boundingBox: Float32Array;
|
|
2214
|
+
hasHoles: boolean;
|
|
2215
|
+
geometryFile?: string;
|
|
1811
2216
|
};
|
|
1812
|
-
/** List of categories that won't be converted to fragments. */
|
|
1813
|
-
excludedCategories: Set<number>;
|
|
1814
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
1815
|
-
saveLocations: boolean;
|
|
1816
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1817
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1818
|
-
autoSetWasm: boolean;
|
|
1819
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1820
2217
|
}
|
|
1821
|
-
|
|
2218
|
+
export interface StreamedAsset {
|
|
2219
|
+
id: number;
|
|
2220
|
+
geometries: {
|
|
2221
|
+
geometryID: number;
|
|
2222
|
+
transformation: number[];
|
|
2223
|
+
color: number[];
|
|
2224
|
+
}[];
|
|
2225
|
+
}
|
|
1822
2226
|
import * as WEBIFC from "web-ifc";
|
|
1823
|
-
import
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
2227
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
2228
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
2229
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
2230
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
2231
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
2232
|
+
type: number;
|
|
2233
|
+
data: {
|
|
2234
|
+
[id: number]: any;
|
|
2235
|
+
};
|
|
2236
|
+
}>;
|
|
2237
|
+
onProgress: AsyncEvent<number>;
|
|
2238
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
2239
|
+
/** {@link Disposable.onDisposed} */
|
|
2240
|
+
readonly onDisposed: Event<string>;
|
|
2241
|
+
enabled: boolean;
|
|
2242
|
+
settings: PropertiesStreamingSettings;
|
|
2243
|
+
webIfc: WEBIFC.IfcAPI;
|
|
2244
|
+
dispose(): Promise<void>;
|
|
2245
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
2246
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
2247
|
+
private readIfcFile;
|
|
2248
|
+
private streamIfcFile;
|
|
2249
|
+
private streamAllProperties;
|
|
2250
|
+
private getIndices;
|
|
2251
|
+
private cleanUp;
|
|
1835
2252
|
}
|
|
1836
2253
|
import { NavigationMode } from "./types";
|
|
1837
2254
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1838
2255
|
/**
|
|
1839
|
-
* A {@link NavigationMode} that allows first person navigation,
|
|
1840
|
-
* simulating FPS video games.
|
|
2256
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
1841
2257
|
*/
|
|
1842
2258
|
export declare class FirstPersonMode implements NavigationMode {
|
|
1843
2259
|
private camera;
|
|
@@ -1850,11 +2266,90 @@ export declare class FirstPersonMode implements NavigationMode {
|
|
|
1850
2266
|
set(active: boolean): void;
|
|
1851
2267
|
private setupFirstPersonCamera;
|
|
1852
2268
|
}
|
|
2269
|
+
import * as THREE from "three";
|
|
2270
|
+
import { Disposable, Event } from "../../Types";
|
|
2271
|
+
/**
|
|
2272
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
2273
|
+
* to work with tools like the
|
|
2274
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
2275
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
2276
|
+
*/
|
|
2277
|
+
export declare class Mouse implements Disposable {
|
|
2278
|
+
dom: HTMLCanvasElement;
|
|
2279
|
+
private _event?;
|
|
2280
|
+
private _position;
|
|
2281
|
+
/** {@link Disposable.onDisposed} */
|
|
2282
|
+
readonly onDisposed: Event<unknown>;
|
|
2283
|
+
constructor(dom: HTMLCanvasElement);
|
|
2284
|
+
/**
|
|
2285
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2286
|
+
*/
|
|
2287
|
+
get position(): THREE.Vector2;
|
|
2288
|
+
/** {@link Disposable.dispose} */
|
|
2289
|
+
dispose(): void;
|
|
2290
|
+
private getPositionY;
|
|
2291
|
+
private getPositionX;
|
|
2292
|
+
private updateMouseInfo;
|
|
2293
|
+
private setupEvents;
|
|
2294
|
+
}
|
|
2295
|
+
import * as THREE from "three";
|
|
2296
|
+
import { Components } from "../../Components";
|
|
2297
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2298
|
+
import { Mouse } from "./mouse";
|
|
2299
|
+
/**
|
|
2300
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
2301
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
2302
|
+
* events.
|
|
2303
|
+
*/
|
|
2304
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2305
|
+
/** {@link Component.enabled} */
|
|
2306
|
+
enabled: boolean;
|
|
2307
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2308
|
+
components: Components;
|
|
2309
|
+
/** {@link Disposable.onDisposed} */
|
|
2310
|
+
readonly onDisposed: Event<unknown>;
|
|
2311
|
+
/** The position of the mouse in the screen. */
|
|
2312
|
+
readonly mouse: Mouse;
|
|
2313
|
+
/**
|
|
2314
|
+
* A reference to the Three.js Raycaster instance.
|
|
2315
|
+
* This is used for raycasting operations.
|
|
2316
|
+
*/
|
|
2317
|
+
readonly three: THREE.Raycaster;
|
|
2318
|
+
/**
|
|
2319
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2320
|
+
* This is used to access the camera and meshes.
|
|
2321
|
+
*/
|
|
2322
|
+
world: World;
|
|
2323
|
+
constructor(components: Components, world: World);
|
|
2324
|
+
/** {@link Disposable.dispose} */
|
|
2325
|
+
dispose(): void;
|
|
2326
|
+
/**
|
|
2327
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2328
|
+
* the first item found. This also takes into account the clipping planes
|
|
2329
|
+
* used by the renderer.
|
|
2330
|
+
*
|
|
2331
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2332
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2333
|
+
* {@link Components.meshes}.
|
|
2334
|
+
*/
|
|
2335
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2336
|
+
/**
|
|
2337
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2338
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2339
|
+
*
|
|
2340
|
+
* @param origin - The origin of the ray.
|
|
2341
|
+
* @param direction - The direction of the ray.
|
|
2342
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2343
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2344
|
+
*/
|
|
2345
|
+
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;
|
|
2346
|
+
private intersect;
|
|
2347
|
+
private filterClippingPlanes;
|
|
2348
|
+
}
|
|
1853
2349
|
import { NavigationMode } from "./types";
|
|
1854
2350
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1855
2351
|
/**
|
|
1856
|
-
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1857
|
-
* like in many 3D and CAD softwares.
|
|
2352
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
1858
2353
|
*/
|
|
1859
2354
|
export declare class OrbitMode implements NavigationMode {
|
|
1860
2355
|
camera: OrthoPerspectiveCamera;
|
|
@@ -1870,8 +2365,7 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
1870
2365
|
import { NavigationMode } from "./types";
|
|
1871
2366
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1872
2367
|
/**
|
|
1873
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1874
|
-
* like many BIM tools.
|
|
2368
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
1875
2369
|
*/
|
|
1876
2370
|
export declare class PlanMode implements NavigationMode {
|
|
1877
2371
|
private camera;
|
|
@@ -1900,12 +2394,20 @@ export declare class ProjectionManager {
|
|
|
1900
2394
|
* Event that fires when the {@link CameraProjection} changes.
|
|
1901
2395
|
*/
|
|
1902
2396
|
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2397
|
+
/**
|
|
2398
|
+
* Current projection mode of the camera.
|
|
2399
|
+
* Default is "Perspective".
|
|
2400
|
+
*/
|
|
1903
2401
|
current: CameraProjection;
|
|
2402
|
+
/**
|
|
2403
|
+
* The camera controlled by this ProjectionManager.
|
|
2404
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2405
|
+
*/
|
|
1904
2406
|
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1905
|
-
private _component;
|
|
1906
|
-
private _previousDistance;
|
|
1907
2407
|
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1908
2408
|
matchOrthoDistanceEnabled: boolean;
|
|
2409
|
+
private _component;
|
|
2410
|
+
private _previousDistance;
|
|
1909
2411
|
constructor(camera: OrthoPerspectiveCamera);
|
|
1910
2412
|
/**
|
|
1911
2413
|
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
@@ -1934,8 +2436,7 @@ export type CameraProjection = "Perspective" | "Orthographic";
|
|
|
1934
2436
|
*/
|
|
1935
2437
|
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1936
2438
|
/**
|
|
1937
|
-
* An object that determines the behavior of the camera controls
|
|
1938
|
-
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2439
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1939
2440
|
*/
|
|
1940
2441
|
export interface NavigationMode {
|
|
1941
2442
|
/** The unique ID of this navigation mode. */
|
|
@@ -1952,6 +2453,16 @@ export interface NavigationMode {
|
|
|
1952
2453
|
/** Whether this navigation mode is active or not. */
|
|
1953
2454
|
enabled: boolean;
|
|
1954
2455
|
}
|
|
2456
|
+
import * as WEBIFC from "web-ifc";
|
|
2457
|
+
import * as THREE from "three";
|
|
2458
|
+
export declare class Units {
|
|
2459
|
+
factor: number;
|
|
2460
|
+
complement: number;
|
|
2461
|
+
apply(matrix: THREE.Matrix4): void;
|
|
2462
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2463
|
+
private getLengthUnits;
|
|
2464
|
+
private getScaleMatrix;
|
|
2465
|
+
}
|
|
1955
2466
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1956
2467
|
export interface ModelsRelationMap {
|
|
1957
2468
|
[modelID: string]: RelationsMap;
|
|
@@ -1976,16 +2487,6 @@ export type InverseAttributes = [
|
|
|
1976
2487
|
"ContainsElements"
|
|
1977
2488
|
];
|
|
1978
2489
|
export type InverseAttribute = InverseAttributes[number];
|
|
1979
|
-
import * as WEBIFC from "web-ifc";
|
|
1980
|
-
import * as THREE from "three";
|
|
1981
|
-
export declare class Units {
|
|
1982
|
-
factor: number;
|
|
1983
|
-
complement: number;
|
|
1984
|
-
apply(matrix: THREE.Matrix4): void;
|
|
1985
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1986
|
-
private getLengthUnits;
|
|
1987
|
-
private getScaleMatrix;
|
|
1988
|
-
}
|
|
1989
2490
|
import { BufferGeometry } from "three";
|
|
1990
2491
|
import * as THREE from "three";
|
|
1991
2492
|
export declare class TransformHelper {
|