@thatopen/components 2.0.9 → 2.0.10
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 +42 -18
- 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 +862 -383
- package/dist/namespace.d.ts +1501 -1000
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,72 +1,22 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import { Component, Disposable, Event } from "../Types";
|
|
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.
|
|
9
|
-
*/
|
|
10
|
-
export declare class Components implements Disposable {
|
|
11
|
-
static readonly release = "1.4.21";
|
|
12
|
-
/** {@link Disposable.onDisposed} */
|
|
13
|
-
readonly onDisposed: Event<void>;
|
|
14
|
-
/** The list of components created in this app. */
|
|
15
|
-
readonly list: Map<string, Component>;
|
|
16
|
-
/** If disabled, the animation loop will be stopped. */
|
|
17
|
-
enabled: boolean;
|
|
18
|
-
private _clock;
|
|
19
|
-
add(uuid: string, instance: Component): void;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
22
|
-
* doesn't exist, it will instance it automatically.
|
|
23
|
-
*
|
|
24
|
-
* @param Component - The component to get or create.
|
|
25
|
-
*/
|
|
26
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
27
|
-
constructor();
|
|
28
|
-
/**
|
|
29
|
-
* Initializes the library. It should be called at the start of the app after
|
|
30
|
-
* initializing the scene, the renderer and the
|
|
31
|
-
* camera. Additionally, if any component that need a raycaster is
|
|
32
|
-
* used, the {@link raycaster} will need to be initialized.
|
|
33
|
-
*/
|
|
34
|
-
init(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
37
|
-
* the library. A memory leak will be created if:
|
|
38
|
-
*
|
|
39
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
40
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
41
|
-
* Angular, Vue, etc).
|
|
42
|
-
*
|
|
43
|
-
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
44
|
-
* referenced by a reference type (object or array).
|
|
45
|
-
*
|
|
46
|
-
* You can learn more about how Three.js handles memory leaks
|
|
47
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
48
|
-
*
|
|
49
|
-
*/
|
|
50
|
-
dispose(): void;
|
|
51
|
-
private update;
|
|
52
|
-
private static setupBVH;
|
|
53
|
-
}
|
|
54
2
|
import * as THREE from "three";
|
|
55
3
|
import { Components } from "../Components";
|
|
56
4
|
import { Component } from "../Types";
|
|
57
5
|
/**
|
|
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).
|
|
6
|
+
* 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
7
|
*/
|
|
61
8
|
export declare class Disposer extends Component {
|
|
62
9
|
private _disposedComponents;
|
|
63
10
|
/** {@link Component.enabled} */
|
|
64
11
|
enabled: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* A unique identifier for the component.
|
|
14
|
+
* This UUID is used to register the component within the Components system.
|
|
15
|
+
*/
|
|
65
16
|
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
66
17
|
constructor(components: Components);
|
|
67
18
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @return the list of UUIDs of deleted components.
|
|
19
|
+
* Return the UUIDs of all disposed components.
|
|
70
20
|
*/
|
|
71
21
|
get(): Set<string>;
|
|
72
22
|
/**
|
|
@@ -94,69 +44,158 @@ export declare class Disposer extends Component {
|
|
|
94
44
|
private disposeChildren;
|
|
95
45
|
private static disposeMaterial;
|
|
96
46
|
}
|
|
47
|
+
import { Component, Disposable, Event } from "../Types";
|
|
48
|
+
/**
|
|
49
|
+
* 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.
|
|
50
|
+
*/
|
|
51
|
+
export declare class Components implements Disposable {
|
|
52
|
+
/**
|
|
53
|
+
* The version of the @thatopen/components library.
|
|
54
|
+
*/
|
|
55
|
+
static readonly release = "2.0.8";
|
|
56
|
+
/** {@link Disposable.onDisposed} */
|
|
57
|
+
readonly onDisposed: Event<void>;
|
|
58
|
+
/**
|
|
59
|
+
* The list of components created in this app.
|
|
60
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
61
|
+
*/
|
|
62
|
+
readonly list: Map<string, Component>;
|
|
63
|
+
/**
|
|
64
|
+
* If disabled, the animation loop will be stopped.
|
|
65
|
+
* Default value is false.
|
|
66
|
+
*/
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
private _clock;
|
|
69
|
+
/**
|
|
70
|
+
* Adds a component to the list of components.
|
|
71
|
+
* Throws an error if a component with the same UUID already exists.
|
|
72
|
+
*
|
|
73
|
+
* @param uuid - The unique identifier of the component.
|
|
74
|
+
* @param instance - The instance of the component to be added.
|
|
75
|
+
*
|
|
76
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
add(uuid: string, instance: Component): void;
|
|
81
|
+
/**
|
|
82
|
+
* Retrieves a component instance by its constructor function.
|
|
83
|
+
* If the component does not exist in the list, it will be created and added.
|
|
84
|
+
*
|
|
85
|
+
* @template U - The type of the component to retrieve.
|
|
86
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
87
|
+
*
|
|
88
|
+
* @returns The instance of the requested component.
|
|
89
|
+
*
|
|
90
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
91
|
+
*
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
95
|
+
constructor();
|
|
96
|
+
/**
|
|
97
|
+
* Initializes the Components instance.
|
|
98
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
99
|
+
* and calls the update method.
|
|
100
|
+
*
|
|
101
|
+
* @returns {void}
|
|
102
|
+
*/
|
|
103
|
+
init(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
106
|
+
* the library. A memory leak will be created if:
|
|
107
|
+
*
|
|
108
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
109
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
110
|
+
* Angular, Vue, etc).
|
|
111
|
+
*
|
|
112
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
113
|
+
* referenced by a reference type (object or array).
|
|
114
|
+
*
|
|
115
|
+
* You can learn more about how Three.js handles memory leaks
|
|
116
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
dispose(): void;
|
|
120
|
+
private update;
|
|
121
|
+
private static setupBVH;
|
|
122
|
+
}
|
|
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,54 +405,96 @@ 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
|
+
}
|
|
420
|
+
export declare class UUID {
|
|
421
|
+
private static _pattern;
|
|
422
|
+
private static _lut;
|
|
423
|
+
static create(): string;
|
|
424
|
+
static validate(uuid: string): void;
|
|
425
|
+
}
|
|
426
|
+
import * as THREE from "three";
|
|
427
|
+
import { Component, Components, Event, World } from "../core";
|
|
428
|
+
export interface VertexPickerConfig {
|
|
429
|
+
showOnlyVertex: boolean;
|
|
430
|
+
snapDistance: number;
|
|
431
|
+
previewElement: HTMLElement;
|
|
432
|
+
}
|
|
433
|
+
export declare class VertexPicker extends Component {
|
|
434
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
435
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
436
|
+
components: Components;
|
|
437
|
+
private _pickedPoint;
|
|
438
|
+
private _config;
|
|
439
|
+
private _enabled;
|
|
440
|
+
private _workingPlane;
|
|
441
|
+
set enabled(value: boolean);
|
|
442
|
+
get enabled(): boolean;
|
|
443
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
444
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
445
|
+
get workingPlane(): THREE.Plane | null;
|
|
446
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
447
|
+
get config(): Partial<VertexPickerConfig>;
|
|
448
|
+
dispose(): void;
|
|
449
|
+
get(world: World): THREE.Vector3 | null;
|
|
450
|
+
private getClosestVertex;
|
|
451
|
+
private getVertices;
|
|
452
|
+
private getVertex;
|
|
453
|
+
}
|
|
275
454
|
import { Components } from "../Components";
|
|
276
455
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
277
456
|
import { Component, Event, Disposable, World } from "../Types";
|
|
278
457
|
/**
|
|
279
|
-
* A
|
|
280
|
-
* that are not visible to the camera.
|
|
458
|
+
* A component that manages and provides culling functionality for meshes in a 3D scene.
|
|
281
459
|
*/
|
|
282
460
|
export declare class Cullers extends Component implements Disposable {
|
|
283
461
|
/**
|
|
284
|
-
* A unique identifier for the
|
|
462
|
+
* A unique identifier for the component.
|
|
463
|
+
* This UUID is used to register the component within the Components system.
|
|
285
464
|
*/
|
|
286
465
|
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
287
466
|
/**
|
|
288
|
-
|
|
289
|
-
|
|
467
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
468
|
+
*/
|
|
469
|
+
readonly onDisposed: Event<unknown>;
|
|
290
470
|
private _enabled;
|
|
291
471
|
/**
|
|
292
472
|
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
293
473
|
*/
|
|
294
474
|
list: Map<string, MeshCullerRenderer>;
|
|
475
|
+
/** {@link Component.enabled} */
|
|
476
|
+
get enabled(): boolean;
|
|
477
|
+
/** {@link Component.enabled} */
|
|
478
|
+
set enabled(value: boolean);
|
|
479
|
+
constructor(components: Components);
|
|
295
480
|
/**
|
|
296
|
-
*
|
|
297
|
-
|
|
298
|
-
readonly onDisposed: Event<unknown>;
|
|
299
|
-
/**
|
|
300
|
-
* Gets the enabled state of the Cullers component.
|
|
481
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
482
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
301
483
|
*
|
|
302
|
-
* @
|
|
484
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
485
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
486
|
+
*
|
|
487
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
303
488
|
*/
|
|
304
|
-
|
|
489
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
305
490
|
/**
|
|
306
|
-
*
|
|
307
|
-
*
|
|
491
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
492
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
493
|
+
*
|
|
494
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
308
495
|
*
|
|
309
|
-
* @
|
|
496
|
+
* @returns {void}
|
|
310
497
|
*/
|
|
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
498
|
delete(world: World): void;
|
|
324
499
|
/** {@link Disposable.dispose} */
|
|
325
500
|
dispose(): void;
|
|
@@ -327,17 +502,48 @@ export declare class Cullers extends Component implements Disposable {
|
|
|
327
502
|
import { MiniMap } from "./src";
|
|
328
503
|
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
329
504
|
import { Components } from "../Components";
|
|
505
|
+
/**
|
|
506
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID.
|
|
507
|
+
*/
|
|
330
508
|
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
509
|
+
/**
|
|
510
|
+
* A unique identifier for the component.
|
|
511
|
+
* This UUID is used to register the component within the Components system.
|
|
512
|
+
*/
|
|
331
513
|
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
514
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
332
515
|
readonly onAfterUpdate: Event<unknown>;
|
|
516
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
333
517
|
readonly onBeforeUpdate: Event<unknown>;
|
|
518
|
+
/** {@link Disposable.onDisposed} */
|
|
334
519
|
readonly onDisposed: Event<unknown>;
|
|
520
|
+
/** {@link Component.enabled} */
|
|
335
521
|
enabled: boolean;
|
|
522
|
+
/**
|
|
523
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
524
|
+
*/
|
|
336
525
|
list: Map<string, MiniMap>;
|
|
337
526
|
constructor(components: Components);
|
|
527
|
+
/**
|
|
528
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
529
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
530
|
+
*
|
|
531
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
532
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
533
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
534
|
+
*/
|
|
338
535
|
create(world: World): MiniMap;
|
|
536
|
+
/**
|
|
537
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
538
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
539
|
+
*
|
|
540
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
541
|
+
* @returns {void}
|
|
542
|
+
*/
|
|
339
543
|
delete(id: string): void;
|
|
544
|
+
/** {@link Disposable.dispose} */
|
|
340
545
|
dispose(): void;
|
|
546
|
+
/** {@link Updateable.update} */
|
|
341
547
|
update(): void;
|
|
342
548
|
}
|
|
343
549
|
import * as THREE from "three";
|
|
@@ -345,23 +551,36 @@ import { Components } from "../Components";
|
|
|
345
551
|
import { SimpleCamera } from "..";
|
|
346
552
|
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
347
553
|
/**
|
|
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.
|
|
554
|
+
* 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
555
|
*/
|
|
353
556
|
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
354
557
|
/**
|
|
355
|
-
*
|
|
558
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
356
559
|
*/
|
|
357
|
-
_mode: NavigationMode | null;
|
|
358
560
|
readonly projection: ProjectionManager;
|
|
561
|
+
/**
|
|
562
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
563
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
564
|
+
*/
|
|
359
565
|
readonly threeOrtho: THREE.OrthographicCamera;
|
|
566
|
+
/**
|
|
567
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
568
|
+
* This camera is used when the projection mode is set to perspective.
|
|
569
|
+
*/
|
|
360
570
|
readonly threePersp: THREE.PerspectiveCamera;
|
|
361
571
|
protected readonly _userInputButtons: any;
|
|
362
572
|
protected readonly _frustumSize = 50;
|
|
363
573
|
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
574
|
+
protected _mode: NavigationMode | null;
|
|
364
575
|
private previousSize;
|
|
576
|
+
/**
|
|
577
|
+
* Getter for the current navigation mode.
|
|
578
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
579
|
+
*
|
|
580
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
581
|
+
*
|
|
582
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
583
|
+
*/
|
|
365
584
|
get mode(): NavigationMode;
|
|
366
585
|
constructor(components: Components);
|
|
367
586
|
/** {@link Disposable.dispose} */
|
|
@@ -391,349 +610,110 @@ export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
|
391
610
|
private newOrthoCamera;
|
|
392
611
|
private setOrthoPerspCameraAspect;
|
|
393
612
|
}
|
|
394
|
-
import * as
|
|
613
|
+
import * as WEBIFC from "web-ifc";
|
|
614
|
+
import * as FRAG from "@thatopen/fragments";
|
|
395
615
|
import { Component, Components } from "../../core";
|
|
396
|
-
export interface MeasureEdge {
|
|
397
|
-
distance: number;
|
|
398
|
-
points: THREE.Vector3[];
|
|
399
|
-
}
|
|
400
|
-
export declare class MeasurementUtils extends Component {
|
|
401
|
-
enabled: boolean;
|
|
402
|
-
static uuid: string;
|
|
403
|
-
constructor(components: Components);
|
|
404
|
-
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
405
|
-
edges: MeasureEdge[];
|
|
406
|
-
indices: Set<number>;
|
|
407
|
-
} | null;
|
|
408
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
409
|
-
private getFaceData;
|
|
410
|
-
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
411
|
-
p1: THREE.Vector3;
|
|
412
|
-
p2: THREE.Vector3;
|
|
413
|
-
p3: THREE.Vector3;
|
|
414
|
-
faceNormal: THREE.Vector3;
|
|
415
|
-
};
|
|
416
|
-
private round;
|
|
417
|
-
}
|
|
418
|
-
import * as THREE from "three";
|
|
419
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
420
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
421
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
422
616
|
/**
|
|
423
|
-
*
|
|
424
|
-
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
617
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
425
618
|
*/
|
|
426
|
-
export declare class
|
|
427
|
-
static readonly uuid: "
|
|
619
|
+
export declare class IfcJsonExporter extends Component {
|
|
620
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
428
621
|
/** {@link Component.enabled} */
|
|
429
622
|
enabled: boolean;
|
|
430
|
-
/** {@link Disposable.onDisposed} */
|
|
431
|
-
readonly onDisposed: Event<unknown>;
|
|
432
|
-
private _absoluteMin;
|
|
433
|
-
private _absoluteMax;
|
|
434
|
-
private _meshes;
|
|
435
623
|
constructor(components: Components);
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
dispose(): void;
|
|
446
|
-
get(): THREE.Box3;
|
|
447
|
-
getSphere(): THREE.Sphere;
|
|
448
|
-
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
449
|
-
reset(): void;
|
|
450
|
-
add(group: FragmentsGroup): void;
|
|
451
|
-
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
452
|
-
private static getFragmentBounds;
|
|
624
|
+
/**
|
|
625
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
626
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
627
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
628
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
629
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
630
|
+
* to make the location data available (e.g. absolute position of building).
|
|
631
|
+
*/
|
|
632
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
453
633
|
}
|
|
454
|
-
import * as
|
|
455
|
-
import
|
|
456
|
-
import {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
634
|
+
import * as WEBIFC from "web-ifc";
|
|
635
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
636
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
637
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
638
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
639
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
640
|
+
interface ChangeMap {
|
|
641
|
+
[modelID: string]: Set<number>;
|
|
642
|
+
}
|
|
643
|
+
interface AttributeListener {
|
|
644
|
+
[modelID: string]: {
|
|
645
|
+
[expressID: number]: {
|
|
646
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
647
|
+
};
|
|
460
648
|
};
|
|
461
649
|
}
|
|
462
|
-
export declare class
|
|
463
|
-
static readonly uuid: "
|
|
464
|
-
/** {@link Component.enabled} */
|
|
465
|
-
enabled: boolean;
|
|
466
|
-
list: Classification;
|
|
650
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
651
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
467
652
|
/** {@link Disposable.onDisposed} */
|
|
468
|
-
readonly onDisposed: Event<
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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";
|
|
653
|
+
readonly onDisposed: Event<string>;
|
|
654
|
+
readonly onRequestFile: Event<unknown>;
|
|
655
|
+
ifcToExport: ArrayBuffer | null;
|
|
656
|
+
readonly onElementToPset: Event<{
|
|
657
|
+
model: FragmentsGroup;
|
|
658
|
+
psetID: number;
|
|
659
|
+
elementID: number;
|
|
660
|
+
}>;
|
|
661
|
+
readonly onPropToPset: Event<{
|
|
662
|
+
model: FragmentsGroup;
|
|
663
|
+
psetID: number;
|
|
664
|
+
propID: number;
|
|
665
|
+
}>;
|
|
666
|
+
readonly onPsetRemoved: Event<{
|
|
667
|
+
model: FragmentsGroup;
|
|
668
|
+
psetID: number;
|
|
669
|
+
}>;
|
|
670
|
+
readonly onDataChanged: Event<{
|
|
671
|
+
model: FragmentsGroup;
|
|
672
|
+
expressID: number;
|
|
673
|
+
}>;
|
|
674
|
+
wasm: {
|
|
675
|
+
path: string;
|
|
676
|
+
absolute: boolean;
|
|
677
|
+
};
|
|
498
678
|
enabled: boolean;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
readonly onDisposed: Event<unknown>;
|
|
503
|
-
list: Set<string>;
|
|
679
|
+
attributeListeners: AttributeListener;
|
|
680
|
+
selectedModel?: FragmentsGroup;
|
|
681
|
+
changeMap: ChangeMap;
|
|
504
682
|
constructor(components: Components);
|
|
505
683
|
dispose(): void;
|
|
506
|
-
|
|
684
|
+
private increaseMaxID;
|
|
685
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
686
|
+
private newGUID;
|
|
687
|
+
private getOwnerHistory;
|
|
688
|
+
private registerChange;
|
|
689
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
690
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
691
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
692
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
693
|
+
}>;
|
|
694
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
695
|
+
private newSingleProperty;
|
|
696
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
697
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
698
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
699
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
700
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
701
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
702
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
703
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
507
704
|
}
|
|
508
|
-
|
|
509
|
-
import * as
|
|
510
|
-
import
|
|
511
|
-
import {
|
|
512
|
-
import { RelationsMap } from "
|
|
705
|
+
export {};
|
|
706
|
+
import * as WEBIFC from "web-ifc";
|
|
707
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
708
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
709
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
513
710
|
/**
|
|
514
|
-
*
|
|
515
|
-
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
711
|
+
* 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.
|
|
516
712
|
*/
|
|
517
|
-
export declare class
|
|
518
|
-
static readonly uuid: "
|
|
713
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
714
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
519
715
|
/** {@link Disposable.onDisposed} */
|
|
520
|
-
readonly onDisposed: Event<
|
|
521
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
522
|
-
readonly onFragmentsDisposed: Event<{
|
|
523
|
-
groupID: string;
|
|
524
|
-
fragmentIDs: string[];
|
|
525
|
-
}>;
|
|
526
|
-
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
527
|
-
readonly list: Map<string, Fragment>;
|
|
528
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
529
|
-
/** {@link Component.enabled} */
|
|
530
|
-
enabled: boolean;
|
|
531
|
-
baseCoordinationModel: string;
|
|
532
|
-
private _loader;
|
|
533
|
-
/** The list of meshes of the created fragments. */
|
|
534
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
535
|
-
constructor(components: Components);
|
|
536
|
-
/** {@link Disposable.dispose} */
|
|
537
|
-
dispose(): void;
|
|
538
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
539
|
-
/**
|
|
540
|
-
* Loads a binar file that contain fragment geometry.
|
|
541
|
-
* @param data - The binary data to load.
|
|
542
|
-
* @param config - Optional configuration for loading.
|
|
543
|
-
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
544
|
-
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
545
|
-
* @returns The loaded FragmentsGroup.
|
|
546
|
-
*/
|
|
547
|
-
load(data: Uint8Array, config?: Partial<{
|
|
548
|
-
coordinate: boolean;
|
|
549
|
-
name: string;
|
|
550
|
-
properties: FRAGS.IfcProperties;
|
|
551
|
-
relationsMap: RelationsMap;
|
|
552
|
-
}>): FragmentsGroup;
|
|
553
|
-
/**
|
|
554
|
-
* Export the specified fragments.
|
|
555
|
-
* @param group - the fragments group to be exported.
|
|
556
|
-
* @returns the exported data as binary buffer.
|
|
557
|
-
*/
|
|
558
|
-
export(group: FragmentsGroup): Uint8Array;
|
|
559
|
-
coordinate(models?: FragmentsGroup[]): void;
|
|
560
|
-
}
|
|
561
|
-
import * as WEBIFC from "web-ifc";
|
|
562
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
563
|
-
import { IfcFragmentSettings } from "./src";
|
|
564
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
565
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
566
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
567
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
568
|
-
readonly onSetup: Event<void>;
|
|
569
|
-
/** {@link Disposable.onDisposed} */
|
|
570
|
-
readonly onDisposed: Event<string>;
|
|
571
|
-
settings: IfcFragmentSettings;
|
|
572
|
-
enabled: boolean;
|
|
573
|
-
webIfc: WEBIFC.IfcAPI;
|
|
574
|
-
private _material;
|
|
575
|
-
private _spatialTree;
|
|
576
|
-
private _metaData;
|
|
577
|
-
private _fragmentInstances;
|
|
578
|
-
private _civil;
|
|
579
|
-
private _visitedFragments;
|
|
580
|
-
private _materialT;
|
|
581
|
-
constructor(components: Components);
|
|
582
|
-
dispose(): void;
|
|
583
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
584
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
585
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
586
|
-
private getAllGeometries;
|
|
587
|
-
cleanUp(): void;
|
|
588
|
-
private getMesh;
|
|
589
|
-
private getGeometry;
|
|
590
|
-
private autoSetWasm;
|
|
591
|
-
}
|
|
592
|
-
import * as WEBIFC from "web-ifc";
|
|
593
|
-
import { Components, Disposable, Event, Component } from "../../core";
|
|
594
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
595
|
-
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
596
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
597
|
-
onGeometryStreamed: Event<{
|
|
598
|
-
buffer: Uint8Array;
|
|
599
|
-
data: StreamedGeometries;
|
|
600
|
-
}>;
|
|
601
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
602
|
-
onProgress: Event<number>;
|
|
603
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
604
|
-
/** {@link Disposable.onDisposed} */
|
|
605
|
-
readonly onDisposed: Event<unknown>;
|
|
606
|
-
settings: IfcStreamingSettings;
|
|
607
|
-
enabled: boolean;
|
|
608
|
-
webIfc: WEBIFC.IfcAPI;
|
|
609
|
-
private _spatialTree;
|
|
610
|
-
private _metaData;
|
|
611
|
-
private _visitedGeometries;
|
|
612
|
-
private _streamSerializer;
|
|
613
|
-
private _geometries;
|
|
614
|
-
private _geometryCount;
|
|
615
|
-
private _civil;
|
|
616
|
-
private _groupSerializer;
|
|
617
|
-
private _assets;
|
|
618
|
-
private _meshesWithHoles;
|
|
619
|
-
constructor(components: Components);
|
|
620
|
-
dispose(): void;
|
|
621
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
622
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
623
|
-
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>;
|
|
716
|
+
readonly onDisposed: Event<string>;
|
|
737
717
|
enabled: boolean;
|
|
738
718
|
readonly onRelationsIndexed: Event<{
|
|
739
719
|
modelID: string;
|
|
@@ -855,120 +835,288 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
855
835
|
dispose(): void;
|
|
856
836
|
}
|
|
857
837
|
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
858
|
-
import * as
|
|
859
|
-
import
|
|
860
|
-
import {
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
[modelID: string]: Set<number>;
|
|
838
|
+
import * as THREE from "three";
|
|
839
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
840
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
841
|
+
export interface Classification {
|
|
842
|
+
[system: string]: {
|
|
843
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
844
|
+
};
|
|
866
845
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
846
|
+
export declare class Classifier extends Component implements Disposable {
|
|
847
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
848
|
+
/** {@link Component.enabled} */
|
|
849
|
+
enabled: boolean;
|
|
850
|
+
list: Classification;
|
|
851
|
+
/** {@link Disposable.onDisposed} */
|
|
852
|
+
readonly onDisposed: Event<unknown>;
|
|
853
|
+
constructor(components: Components);
|
|
854
|
+
private onFragmentsDisposed;
|
|
855
|
+
dispose(): void;
|
|
856
|
+
remove(guid: string): void;
|
|
857
|
+
find(filter?: {
|
|
858
|
+
[name: string]: string[];
|
|
859
|
+
}): FRAGS.FragmentIdMap;
|
|
860
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
861
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
862
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
863
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
864
|
+
bySpatialStructure(model: FRAGS.FragmentsGroup): Promise<void>;
|
|
865
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
866
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
867
|
+
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
868
|
+
}
|
|
869
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
870
|
+
import { Components, Component } from "../../core";
|
|
871
|
+
export declare class Hider extends Component {
|
|
872
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
873
|
+
enabled: boolean;
|
|
874
|
+
constructor(components: Components);
|
|
875
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
876
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
877
|
+
private updateCulledVisibility;
|
|
878
|
+
}
|
|
879
|
+
import * as THREE from "three";
|
|
880
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
881
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
882
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
883
|
+
/**
|
|
884
|
+
* 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.
|
|
885
|
+
*/
|
|
886
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
887
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
888
|
+
/** {@link Component.enabled} */
|
|
889
|
+
enabled: boolean;
|
|
890
|
+
/** {@link Disposable.onDisposed} */
|
|
891
|
+
readonly onDisposed: Event<unknown>;
|
|
892
|
+
private _absoluteMin;
|
|
893
|
+
private _absoluteMax;
|
|
894
|
+
private _meshes;
|
|
895
|
+
constructor(components: Components);
|
|
896
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
897
|
+
width: number;
|
|
898
|
+
height: number;
|
|
899
|
+
depth: number;
|
|
900
|
+
center: THREE.Vector3;
|
|
872
901
|
};
|
|
902
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
903
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
904
|
+
/** {@link Disposable.dispose} */
|
|
905
|
+
dispose(): void;
|
|
906
|
+
get(): THREE.Box3;
|
|
907
|
+
getSphere(): THREE.Sphere;
|
|
908
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
909
|
+
reset(): void;
|
|
910
|
+
add(group: FragmentsGroup): void;
|
|
911
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
912
|
+
private static getFragmentBounds;
|
|
873
913
|
}
|
|
874
|
-
|
|
875
|
-
|
|
914
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
915
|
+
export declare class Exploder extends Component implements Disposable {
|
|
916
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
917
|
+
enabled: boolean;
|
|
918
|
+
height: number;
|
|
919
|
+
groupName: string;
|
|
920
|
+
/** {@link Disposable.onDisposed} */
|
|
921
|
+
readonly onDisposed: Event<unknown>;
|
|
922
|
+
list: Set<string>;
|
|
923
|
+
constructor(components: Components);
|
|
924
|
+
dispose(): void;
|
|
925
|
+
set(active: boolean): void;
|
|
926
|
+
}
|
|
927
|
+
import * as WEBIFC from "web-ifc";
|
|
928
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
929
|
+
import { IfcFragmentSettings } from "./src";
|
|
930
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
931
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
932
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
933
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
934
|
+
readonly onSetup: Event<void>;
|
|
876
935
|
/** {@link Disposable.onDisposed} */
|
|
877
936
|
readonly onDisposed: Event<string>;
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
937
|
+
settings: IfcFragmentSettings;
|
|
938
|
+
enabled: boolean;
|
|
939
|
+
webIfc: WEBIFC.IfcAPI;
|
|
940
|
+
private _material;
|
|
941
|
+
private _spatialTree;
|
|
942
|
+
private _metaData;
|
|
943
|
+
private _fragmentInstances;
|
|
944
|
+
private _civil;
|
|
945
|
+
private _visitedFragments;
|
|
946
|
+
private _materialT;
|
|
947
|
+
constructor(components: Components);
|
|
948
|
+
dispose(): void;
|
|
949
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
950
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
951
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
952
|
+
private getAllGeometries;
|
|
953
|
+
cleanUp(): void;
|
|
954
|
+
private getMesh;
|
|
955
|
+
private getGeometry;
|
|
956
|
+
private autoSetWasm;
|
|
957
|
+
}
|
|
958
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
959
|
+
import * as THREE from "three";
|
|
960
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
961
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
962
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
963
|
+
/**
|
|
964
|
+
* Object that can efficiently load binary files that contain [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
965
|
+
*/
|
|
966
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
967
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
968
|
+
/** {@link Disposable.onDisposed} */
|
|
969
|
+
readonly onDisposed: Event<unknown>;
|
|
970
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
971
|
+
readonly onFragmentsDisposed: Event<{
|
|
972
|
+
groupID: string;
|
|
973
|
+
fragmentIDs: string[];
|
|
897
974
|
}>;
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
975
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
976
|
+
readonly list: Map<string, Fragment>;
|
|
977
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
978
|
+
/** {@link Component.enabled} */
|
|
979
|
+
enabled: boolean;
|
|
980
|
+
baseCoordinationModel: string;
|
|
981
|
+
private _loader;
|
|
982
|
+
/** The list of meshes of the created fragments. */
|
|
983
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
984
|
+
constructor(components: Components);
|
|
985
|
+
/** {@link Disposable.dispose} */
|
|
986
|
+
dispose(): void;
|
|
987
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
988
|
+
/**
|
|
989
|
+
* Loads a binar file that contain fragment geometry.
|
|
990
|
+
* @param data - The binary data to load.
|
|
991
|
+
* @param config - Optional configuration for loading.
|
|
992
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
993
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
994
|
+
* @returns The loaded FragmentsGroup.
|
|
995
|
+
*/
|
|
996
|
+
load(data: Uint8Array, config?: Partial<{
|
|
997
|
+
coordinate: boolean;
|
|
998
|
+
name: string;
|
|
999
|
+
properties: FRAGS.IfcProperties;
|
|
1000
|
+
relationsMap: RelationsMap;
|
|
1001
|
+
}>): FragmentsGroup;
|
|
1002
|
+
/**
|
|
1003
|
+
* Export the specified fragments.
|
|
1004
|
+
* @param group - the fragments group to be exported.
|
|
1005
|
+
* @returns the exported data as binary buffer.
|
|
1006
|
+
*/
|
|
1007
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
1008
|
+
/**
|
|
1009
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
1010
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1011
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1012
|
+
*/
|
|
1013
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
1014
|
+
[modelID: string]: Set<number>;
|
|
901
1015
|
};
|
|
1016
|
+
/**
|
|
1017
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
1018
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
1019
|
+
* @returns A fragment ID map.
|
|
1020
|
+
* @remarks
|
|
1021
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1022
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1023
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
1024
|
+
* 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.
|
|
1025
|
+
*/
|
|
1026
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
1027
|
+
[modelID: string]: Set<number>;
|
|
1028
|
+
}): FRAGS.FragmentIdMap;
|
|
1029
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
1030
|
+
}
|
|
1031
|
+
import * as WEBIFC from "web-ifc";
|
|
1032
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1033
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1034
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1035
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1036
|
+
onGeometryStreamed: Event<{
|
|
1037
|
+
buffer: Uint8Array;
|
|
1038
|
+
data: StreamedGeometries;
|
|
1039
|
+
}>;
|
|
1040
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
1041
|
+
onProgress: Event<number>;
|
|
1042
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
1043
|
+
/** {@link Disposable.onDisposed} */
|
|
1044
|
+
readonly onDisposed: Event<unknown>;
|
|
1045
|
+
settings: IfcStreamingSettings;
|
|
902
1046
|
enabled: boolean;
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1047
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1048
|
+
private _spatialTree;
|
|
1049
|
+
private _metaData;
|
|
1050
|
+
private _visitedGeometries;
|
|
1051
|
+
private _streamSerializer;
|
|
1052
|
+
private _geometries;
|
|
1053
|
+
private _geometryCount;
|
|
1054
|
+
private _civil;
|
|
1055
|
+
private _groupSerializer;
|
|
1056
|
+
private _assets;
|
|
1057
|
+
private _meshesWithHoles;
|
|
906
1058
|
constructor(components: Components);
|
|
907
1059
|
dispose(): void;
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
private
|
|
911
|
-
private
|
|
912
|
-
private
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1060
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1061
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1062
|
+
private readIfcFile;
|
|
1063
|
+
private streamIfcFile;
|
|
1064
|
+
private streamAllGeometries;
|
|
1065
|
+
private cleanUp;
|
|
1066
|
+
private getMesh;
|
|
1067
|
+
private getGeometry;
|
|
1068
|
+
private streamAssets;
|
|
1069
|
+
private streamGeometries;
|
|
1070
|
+
}
|
|
1071
|
+
import * as WEBIFC from "web-ifc";
|
|
1072
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1073
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
1074
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1075
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1076
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1077
|
+
type: number;
|
|
1078
|
+
data: {
|
|
1079
|
+
[id: number]: any;
|
|
1080
|
+
};
|
|
917
1081
|
}>;
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1082
|
+
onProgress: AsyncEvent<number>;
|
|
1083
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1084
|
+
/** {@link Disposable.onDisposed} */
|
|
1085
|
+
readonly onDisposed: Event<string>;
|
|
1086
|
+
enabled: boolean;
|
|
1087
|
+
settings: PropertiesStreamingSettings;
|
|
1088
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1089
|
+
dispose(): Promise<void>;
|
|
1090
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1091
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1092
|
+
private readIfcFile;
|
|
1093
|
+
private streamIfcFile;
|
|
1094
|
+
private streamAllProperties;
|
|
1095
|
+
private cleanUp;
|
|
928
1096
|
}
|
|
929
|
-
export {};
|
|
930
1097
|
import * as THREE from "three";
|
|
931
|
-
import {
|
|
932
|
-
export
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
936
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
937
|
-
readonly onResize: Event<THREE.Vector2>;
|
|
938
|
-
frontOffset: number;
|
|
939
|
-
overrideMaterial: THREE.MeshDepthMaterial;
|
|
940
|
-
backgroundColor: THREE.Color;
|
|
941
|
-
renderer: THREE.WebGLRenderer;
|
|
942
|
-
enabled: boolean;
|
|
943
|
-
world: World;
|
|
944
|
-
private _lockRotation;
|
|
945
|
-
private _camera;
|
|
946
|
-
private _plane;
|
|
947
|
-
private _size;
|
|
948
|
-
private _tempVector1;
|
|
949
|
-
private _tempVector2;
|
|
950
|
-
private _tempTarget;
|
|
951
|
-
private readonly down;
|
|
952
|
-
get lockRotation(): boolean;
|
|
953
|
-
set lockRotation(active: boolean);
|
|
954
|
-
get zoom(): number;
|
|
955
|
-
set zoom(value: number);
|
|
956
|
-
constructor(world: World);
|
|
957
|
-
dispose(): void;
|
|
958
|
-
get(): THREE.OrthographicCamera;
|
|
959
|
-
update(): void;
|
|
960
|
-
getSize(): THREE.Vector2;
|
|
961
|
-
resize(size?: THREE.Vector2): void;
|
|
962
|
-
private updatePlanes;
|
|
1098
|
+
import { Component, Components } from "../../core";
|
|
1099
|
+
export interface MeasureEdge {
|
|
1100
|
+
distance: number;
|
|
1101
|
+
points: THREE.Vector3[];
|
|
963
1102
|
}
|
|
964
|
-
export declare
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1103
|
+
export declare class MeasurementUtils extends Component {
|
|
1104
|
+
enabled: boolean;
|
|
1105
|
+
static uuid: string;
|
|
1106
|
+
constructor(components: Components);
|
|
1107
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
1108
|
+
edges: MeasureEdge[];
|
|
1109
|
+
indices: Set<number>;
|
|
1110
|
+
} | null;
|
|
1111
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
1112
|
+
private getFaceData;
|
|
1113
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
1114
|
+
p1: THREE.Vector3;
|
|
1115
|
+
p2: THREE.Vector3;
|
|
1116
|
+
p3: THREE.Vector3;
|
|
1117
|
+
faceNormal: THREE.Vector3;
|
|
1118
|
+
};
|
|
1119
|
+
private round;
|
|
972
1120
|
}
|
|
973
1121
|
import * as WEBIFC from "web-ifc";
|
|
974
1122
|
export interface IfcItemsCategories {
|
|
@@ -980,9 +1128,6 @@ export declare class IfcCategories {
|
|
|
980
1128
|
export declare const IfcElements: {
|
|
981
1129
|
[key: number]: string;
|
|
982
1130
|
};
|
|
983
|
-
export declare const IfcCategoryMap: {
|
|
984
|
-
[key: number]: string;
|
|
985
|
-
};
|
|
986
1131
|
import * as FRAGS from "@thatopen/fragments";
|
|
987
1132
|
export declare class IfcPropertiesUtils {
|
|
988
1133
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -1008,100 +1153,150 @@ export declare class IfcPropertiesUtils {
|
|
|
1008
1153
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
1009
1154
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
1010
1155
|
}
|
|
1156
|
+
export declare const IfcCategoryMap: {
|
|
1157
|
+
[key: number]: string;
|
|
1158
|
+
};
|
|
1159
|
+
import * as THREE from "three";
|
|
1160
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
1011
1161
|
/**
|
|
1012
|
-
*
|
|
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.
|
|
1162
|
+
* A class representing a 2D minimap in a 3D world.
|
|
1019
1163
|
*/
|
|
1020
|
-
export declare class
|
|
1164
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
1165
|
+
/** {@link Disposable.onDisposed} */
|
|
1166
|
+
readonly onDisposed: Event<unknown>;
|
|
1167
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1168
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1169
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1170
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1171
|
+
/** {@link Resizeable.onResize} */
|
|
1172
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
1021
1173
|
/**
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1174
|
+
* The front offset of the minimap.
|
|
1175
|
+
* It determines how much the minimap's view is offset from the camera's view.
|
|
1176
|
+
* By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
|
|
1024
1177
|
*/
|
|
1025
|
-
|
|
1026
|
-
(): void;
|
|
1027
|
-
} : {
|
|
1028
|
-
(data: T): void;
|
|
1029
|
-
}): void;
|
|
1178
|
+
frontOffset: number;
|
|
1030
1179
|
/**
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1180
|
+
* The override material for the minimap.
|
|
1181
|
+
* It is used to render the depth information of the world onto the minimap.
|
|
1033
1182
|
*/
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1183
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
1184
|
+
/**
|
|
1185
|
+
* The background color of the minimap.
|
|
1186
|
+
* It is used to set the background color of the minimap's renderer.
|
|
1187
|
+
*/
|
|
1188
|
+
backgroundColor: THREE.Color;
|
|
1189
|
+
/**
|
|
1190
|
+
* The WebGL renderer for the minimap.
|
|
1191
|
+
* It is used to render the minimap onto the screen.
|
|
1192
|
+
*/
|
|
1193
|
+
renderer: THREE.WebGLRenderer;
|
|
1194
|
+
/**
|
|
1195
|
+
* A flag indicating whether the minimap is enabled.
|
|
1196
|
+
* If disabled, the minimap will not update or render.
|
|
1197
|
+
*/
|
|
1198
|
+
enabled: boolean;
|
|
1199
|
+
/**
|
|
1200
|
+
* The world in which the minimap is displayed.
|
|
1201
|
+
* It provides access to the 3D scene, camera, and other relevant world elements.
|
|
1202
|
+
*/
|
|
1203
|
+
world: World;
|
|
1204
|
+
private _lockRotation;
|
|
1205
|
+
private _camera;
|
|
1206
|
+
private _plane;
|
|
1207
|
+
private _size;
|
|
1208
|
+
private _tempVector1;
|
|
1209
|
+
private _tempVector2;
|
|
1210
|
+
private _tempTarget;
|
|
1211
|
+
private readonly down;
|
|
1212
|
+
/**
|
|
1213
|
+
* Gets or sets whether the minimap rotation is locked.
|
|
1214
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
1215
|
+
*/
|
|
1216
|
+
get lockRotation(): boolean;
|
|
1217
|
+
/**
|
|
1218
|
+
* Sets whether the minimap rotation is locked.
|
|
1219
|
+
* When rotation is locked, the minimap will always face the same direction as the camera.
|
|
1220
|
+
* @param active - If 'true', rotation is locked. If 'false', rotation is not locked.
|
|
1221
|
+
*/
|
|
1222
|
+
set lockRotation(active: boolean);
|
|
1223
|
+
/**
|
|
1224
|
+
* Gets the current zoom level of the minimap.
|
|
1225
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
1226
|
+
* @returns The current zoom level of the minimap.
|
|
1227
|
+
*/
|
|
1228
|
+
get zoom(): number;
|
|
1229
|
+
/**
|
|
1230
|
+
* Sets the zoom level of the minimap.
|
|
1231
|
+
* The zoom level determines how much of the world is visible on the minimap.
|
|
1232
|
+
* @param value - The new zoom level of the minimap.
|
|
1233
|
+
*/
|
|
1234
|
+
set zoom(value: number);
|
|
1235
|
+
constructor(world: World);
|
|
1236
|
+
/** {@link Disposable.dispose} */
|
|
1237
|
+
dispose(): void;
|
|
1238
|
+
/** Returns the camera used by the MiniMap */
|
|
1239
|
+
get(): THREE.OrthographicCamera;
|
|
1240
|
+
/** {@link Updateable.update} */
|
|
1241
|
+
update(): void;
|
|
1242
|
+
/** {@link Resizeable.getSize} */
|
|
1243
|
+
getSize(): THREE.Vector2;
|
|
1244
|
+
/** {@link Resizeable.resize} */
|
|
1245
|
+
resize(size?: THREE.Vector2): void;
|
|
1246
|
+
private updatePlanes;
|
|
1044
1247
|
}
|
|
1248
|
+
export declare const GeometryTypes: Set<number>;
|
|
1249
|
+
import { InverseAttribute } from "./types";
|
|
1250
|
+
export declare const relToAttributesMap: Map<number, {
|
|
1251
|
+
forRelating: InverseAttribute;
|
|
1252
|
+
forRelated: InverseAttribute;
|
|
1253
|
+
}>;
|
|
1045
1254
|
/**
|
|
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.
|
|
1255
|
+
* 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
1256
|
*/
|
|
1054
|
-
export declare class
|
|
1257
|
+
export declare class Event<T> {
|
|
1055
1258
|
/**
|
|
1056
1259
|
* Add a callback to this event instance.
|
|
1057
1260
|
* @param handler - the callback to be added to this event.
|
|
1058
1261
|
*/
|
|
1059
1262
|
add(handler: T extends void ? {
|
|
1060
|
-
():
|
|
1263
|
+
(): void;
|
|
1061
1264
|
} : {
|
|
1062
|
-
(data: T):
|
|
1265
|
+
(data: T): void;
|
|
1063
1266
|
}): void;
|
|
1064
1267
|
/**
|
|
1065
1268
|
* Removes a callback from this event instance.
|
|
1066
1269
|
* @param handler - the callback to be removed from this event.
|
|
1067
1270
|
*/
|
|
1068
1271
|
remove(handler: T extends void ? {
|
|
1069
|
-
():
|
|
1272
|
+
(): void;
|
|
1070
1273
|
} : {
|
|
1071
|
-
(data: T):
|
|
1274
|
+
(data: T): void;
|
|
1072
1275
|
}): void;
|
|
1073
1276
|
/** Triggers all the callbacks assigned to this event. */
|
|
1074
|
-
trigger: (data?: T) =>
|
|
1277
|
+
trigger: (data?: T) => void;
|
|
1075
1278
|
/** Gets rid of all the suscribed events. */
|
|
1076
1279
|
reset(): void;
|
|
1077
1280
|
private handlers;
|
|
1078
1281
|
}
|
|
1079
1282
|
import { Base } from "./base";
|
|
1080
|
-
import { World } from "./world";
|
|
1081
|
-
import { Event } from "./event";
|
|
1082
|
-
import { Components } from "../../Components";
|
|
1083
1283
|
/**
|
|
1084
|
-
*
|
|
1085
|
-
* or a renderer.
|
|
1284
|
+
* 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.
|
|
1086
1285
|
*/
|
|
1087
|
-
export declare abstract class
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1286
|
+
export declare abstract class Component extends Base {
|
|
1287
|
+
/**
|
|
1288
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1289
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1290
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1291
|
+
* will not be updated automatically each frame.
|
|
1292
|
+
*/
|
|
1293
|
+
abstract enabled: boolean;
|
|
1095
1294
|
}
|
|
1096
1295
|
import * as THREE from "three";
|
|
1097
1296
|
import CameraControls from "camera-controls";
|
|
1098
1297
|
import { Event } from "./event";
|
|
1099
1298
|
/**
|
|
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.
|
|
1299
|
+
* 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
1300
|
*/
|
|
1106
1301
|
export interface Disposable {
|
|
1107
1302
|
/**
|
|
@@ -1109,13 +1304,11 @@ export interface Disposable {
|
|
|
1109
1304
|
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
1110
1305
|
*/
|
|
1111
1306
|
dispose: () => void | Promise<void>;
|
|
1112
|
-
/** Fired after the tool has been
|
|
1307
|
+
/** Fired after the tool has been disposed. */
|
|
1113
1308
|
readonly onDisposed: Event<any>;
|
|
1114
1309
|
}
|
|
1115
1310
|
/**
|
|
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).
|
|
1311
|
+
* 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
1312
|
*/
|
|
1120
1313
|
export interface Hideable {
|
|
1121
1314
|
/**
|
|
@@ -1126,11 +1319,7 @@ export interface Hideable {
|
|
|
1126
1319
|
visible: boolean;
|
|
1127
1320
|
}
|
|
1128
1321
|
/**
|
|
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.
|
|
1322
|
+
* 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
1323
|
*/
|
|
1135
1324
|
export interface Resizeable {
|
|
1136
1325
|
/**
|
|
@@ -1168,9 +1357,7 @@ export interface Progress {
|
|
|
1168
1357
|
total: number;
|
|
1169
1358
|
}
|
|
1170
1359
|
/**
|
|
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.
|
|
1360
|
+
* Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
|
|
1174
1361
|
*/
|
|
1175
1362
|
export interface Createable {
|
|
1176
1363
|
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
@@ -1203,23 +1390,28 @@ export interface Configurable<T extends Record<string, any>> {
|
|
|
1203
1390
|
*/
|
|
1204
1391
|
config: Required<T>;
|
|
1205
1392
|
}
|
|
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
1393
|
/**
|
|
1214
1394
|
* Whether a camera uses the Camera Controls library.
|
|
1215
1395
|
*/
|
|
1216
1396
|
export interface CameraControllable {
|
|
1397
|
+
/**
|
|
1398
|
+
* An instance of CameraControls that provides camera control functionalities.
|
|
1399
|
+
* This instance is used to manipulate the camera.
|
|
1400
|
+
*/
|
|
1217
1401
|
controls: CameraControls;
|
|
1218
1402
|
}
|
|
1403
|
+
import * as WEBIFC from "web-ifc";
|
|
1404
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
1405
|
+
export declare class SpatialStructure {
|
|
1406
|
+
itemsByFloor: IfcItemsCategories;
|
|
1407
|
+
private _units;
|
|
1408
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1409
|
+
cleanUp(): void;
|
|
1410
|
+
}
|
|
1219
1411
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1220
1412
|
import { Components } from "../../Components";
|
|
1221
1413
|
/**
|
|
1222
|
-
* Base class of the library. Useful for finding out the interfaces
|
|
1414
|
+
* Base class of the library. Useful for finding out the interfaces something implements.
|
|
1223
1415
|
*/
|
|
1224
1416
|
export declare abstract class Base {
|
|
1225
1417
|
components: Components;
|
|
@@ -1235,38 +1427,83 @@ export declare abstract class Base {
|
|
|
1235
1427
|
/** Whether is component is {@link Configurable}. */
|
|
1236
1428
|
isConfigurable: () => this is Configurable<any>;
|
|
1237
1429
|
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1430
|
+
/**
|
|
1431
|
+
* 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.
|
|
1432
|
+
*/
|
|
1433
|
+
export declare class AsyncEvent<T> {
|
|
1434
|
+
/**
|
|
1435
|
+
* Add a callback to this event instance.
|
|
1436
|
+
* @param handler - the callback to be added to this event.
|
|
1437
|
+
*/
|
|
1438
|
+
add(handler: T extends void ? {
|
|
1439
|
+
(): Promise<void>;
|
|
1440
|
+
} : {
|
|
1441
|
+
(data: T): Promise<void>;
|
|
1442
|
+
}): void;
|
|
1443
|
+
/**
|
|
1444
|
+
* Removes a callback from this event instance.
|
|
1445
|
+
* @param handler - the callback to be removed from this event.
|
|
1446
|
+
*/
|
|
1447
|
+
remove(handler: T extends void ? {
|
|
1448
|
+
(): Promise<void>;
|
|
1449
|
+
} : {
|
|
1450
|
+
(data: T): Promise<void>;
|
|
1451
|
+
}): void;
|
|
1452
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
1453
|
+
trigger: (data?: T) => Promise<void>;
|
|
1454
|
+
/** Gets rid of all the suscribed events. */
|
|
1455
|
+
reset(): void;
|
|
1456
|
+
private handlers;
|
|
1457
|
+
}
|
|
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,185 @@ 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 { Disposable, Event } from "../../Types";
|
|
1629
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1630
|
+
import { Components } from "../../Components";
|
|
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
|
+
* Each of the planes created by the clipper.
|
|
1345
1633
|
*/
|
|
1346
|
-
export declare class
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1634
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
1635
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1636
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
1637
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1638
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
1350
1639
|
/** {@link Disposable.onDisposed} */
|
|
1351
1640
|
readonly onDisposed: Event<unknown>;
|
|
1352
|
-
constructor(dom: HTMLCanvasElement);
|
|
1353
1641
|
/**
|
|
1354
|
-
* The
|
|
1642
|
+
* The normal vector of the clipping plane.
|
|
1355
1643
|
*/
|
|
1356
|
-
|
|
1644
|
+
readonly normal: THREE.Vector3;
|
|
1645
|
+
/**
|
|
1646
|
+
* The origin point of the clipping plane.
|
|
1647
|
+
*/
|
|
1648
|
+
readonly origin: THREE.Vector3;
|
|
1649
|
+
/**
|
|
1650
|
+
* The THREE.js Plane object representing the clipping plane.
|
|
1651
|
+
*/
|
|
1652
|
+
readonly three: THREE.Plane;
|
|
1653
|
+
/** The components instance to which this plane belongs. */
|
|
1654
|
+
components: Components;
|
|
1655
|
+
/** The world instance to which this plane belongs. */
|
|
1656
|
+
world: World;
|
|
1657
|
+
protected readonly _helper: THREE.Object3D;
|
|
1658
|
+
protected _visible: boolean;
|
|
1659
|
+
protected _enabled: boolean;
|
|
1660
|
+
private _controlsActive;
|
|
1661
|
+
private readonly _arrowBoundBox;
|
|
1662
|
+
private readonly _planeMesh;
|
|
1663
|
+
private readonly _controls;
|
|
1664
|
+
private readonly _hiddenMaterial;
|
|
1665
|
+
/**
|
|
1666
|
+
* Getter for the enabled state of the clipping plane.
|
|
1667
|
+
* @returns {boolean} The current enabled state.
|
|
1668
|
+
*/
|
|
1669
|
+
get enabled(): boolean;
|
|
1670
|
+
/**
|
|
1671
|
+
* Setter for the enabled state of the clipping plane.
|
|
1672
|
+
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
1673
|
+
* @param {boolean} state - The new enabled state.
|
|
1674
|
+
*/
|
|
1675
|
+
set enabled(state: boolean);
|
|
1676
|
+
/** {@link Hideable.visible } */
|
|
1677
|
+
get visible(): boolean;
|
|
1678
|
+
/** {@link Hideable.visible } */
|
|
1679
|
+
set visible(state: boolean);
|
|
1680
|
+
/** The meshes used for raycasting */
|
|
1681
|
+
get meshes(): THREE.Mesh[];
|
|
1682
|
+
/** The material of the clipping plane representation. */
|
|
1683
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1684
|
+
/** The material of the clipping plane representation. */
|
|
1685
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1686
|
+
/** The size of the clipping plane representation. */
|
|
1687
|
+
get size(): number;
|
|
1688
|
+
/** Sets the size of the clipping plane representation. */
|
|
1689
|
+
set size(size: number);
|
|
1690
|
+
/**
|
|
1691
|
+
* Getter for the helper object of the clipping plane.
|
|
1692
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
1693
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
1694
|
+
*
|
|
1695
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
1696
|
+
*/
|
|
1697
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1698
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1699
|
+
/**
|
|
1700
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
1701
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
1702
|
+
* and positions the helper object accordingly.
|
|
1703
|
+
*
|
|
1704
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
1705
|
+
* @param point - The new origin point for the clipping plane.
|
|
1706
|
+
*
|
|
1707
|
+
* @returns {void}
|
|
1708
|
+
*/
|
|
1709
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
1710
|
+
/** {@link Updateable.update} */
|
|
1711
|
+
update: () => void;
|
|
1357
1712
|
/** {@link Disposable.dispose} */
|
|
1358
1713
|
dispose(): void;
|
|
1359
|
-
private
|
|
1360
|
-
|
|
1361
|
-
private
|
|
1362
|
-
private
|
|
1714
|
+
private reset;
|
|
1715
|
+
protected toggleControls(state: boolean): void;
|
|
1716
|
+
private newTransformControls;
|
|
1717
|
+
private initializeControls;
|
|
1718
|
+
private createArrowBoundingBox;
|
|
1719
|
+
private changeDrag;
|
|
1720
|
+
private notifyDraggingChanged;
|
|
1721
|
+
private preventCameraMovement;
|
|
1722
|
+
private newHelper;
|
|
1723
|
+
private static newPlaneMesh;
|
|
1363
1724
|
}
|
|
1364
1725
|
import * as THREE from "three";
|
|
1726
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
1365
1727
|
import { Components } from "../../Components";
|
|
1366
|
-
|
|
1367
|
-
|
|
1728
|
+
export interface GridConfig {
|
|
1729
|
+
color: THREE.Color;
|
|
1730
|
+
size1: number;
|
|
1731
|
+
size2: number;
|
|
1732
|
+
distance: number;
|
|
1733
|
+
}
|
|
1368
1734
|
/**
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1735
|
+
* An infinite grid. Created by
|
|
1736
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1737
|
+
* and translated to typescript by
|
|
1738
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1372
1739
|
*/
|
|
1373
|
-
export declare class
|
|
1374
|
-
/** {@link Component.enabled} */
|
|
1375
|
-
enabled: boolean;
|
|
1376
|
-
components: Components;
|
|
1740
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1377
1741
|
/** {@link Disposable.onDisposed} */
|
|
1378
1742
|
readonly onDisposed: Event<unknown>;
|
|
1379
|
-
/** The
|
|
1380
|
-
readonly mouse: Mouse;
|
|
1381
|
-
readonly three: THREE.Raycaster;
|
|
1743
|
+
/** The world instance to which this Raycaster belongs. */
|
|
1382
1744
|
world: World;
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1745
|
+
/** The components instance to which this grid belongs. */
|
|
1746
|
+
components: Components;
|
|
1747
|
+
/** {@link Hideable.visible} */
|
|
1748
|
+
get visible(): boolean;
|
|
1749
|
+
/** {@link Hideable.visible} */
|
|
1750
|
+
set visible(visible: boolean);
|
|
1751
|
+
/** The material of the grid. */
|
|
1752
|
+
get material(): THREE.ShaderMaterial;
|
|
1386
1753
|
/**
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
* used by the renderer.
|
|
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}.
|
|
1754
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1755
|
+
* perspective cameras and false for orthographic cameras.
|
|
1394
1756
|
*/
|
|
1395
|
-
|
|
1396
|
-
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;
|
|
1397
|
-
private intersect;
|
|
1398
|
-
private filterClippingPlanes;
|
|
1399
|
-
}
|
|
1400
|
-
import * as THREE from "three";
|
|
1401
|
-
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1402
|
-
import { Components } from "../../Components";
|
|
1403
|
-
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1757
|
+
get fade(): boolean;
|
|
1404
1758
|
/**
|
|
1405
|
-
*
|
|
1759
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1760
|
+
* perspective cameras and false for orthographic cameras.
|
|
1406
1761
|
*/
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
readonly
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
uuid: string;
|
|
1413
|
-
name?: string;
|
|
1414
|
-
readonly onDisposed: Event<unknown>;
|
|
1415
|
-
private _scene?;
|
|
1416
|
-
private _camera?;
|
|
1417
|
-
private _renderer;
|
|
1418
|
-
get scene(): T;
|
|
1419
|
-
set scene(scene: T);
|
|
1420
|
-
get camera(): U;
|
|
1421
|
-
set camera(camera: U);
|
|
1422
|
-
get renderer(): S | null;
|
|
1423
|
-
set renderer(renderer: S | null);
|
|
1424
|
-
constructor(components: Components);
|
|
1425
|
-
update(delta?: number): void;
|
|
1426
|
-
dispose(disposeResources?: boolean): void;
|
|
1427
|
-
}
|
|
1428
|
-
import * as THREE from "three";
|
|
1429
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
1430
|
-
import { Components } from "../../Components";
|
|
1431
|
-
/**
|
|
1432
|
-
* A basic renderer capable of rendering
|
|
1433
|
-
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1434
|
-
*/
|
|
1435
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1436
|
-
enabled: boolean;
|
|
1437
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1438
|
-
container: HTMLElement;
|
|
1439
|
-
three: THREE.WebGLRenderer;
|
|
1440
|
-
protected _canvas: HTMLCanvasElement;
|
|
1441
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1442
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
1443
|
-
protected onContainerUpdated: Event<unknown>;
|
|
1444
|
-
private _resizing;
|
|
1445
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1446
|
-
/** {@link Updateable.update} */
|
|
1447
|
-
update(): void;
|
|
1762
|
+
set fade(active: boolean);
|
|
1763
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
1764
|
+
readonly three: THREE.Mesh;
|
|
1765
|
+
private _fade;
|
|
1766
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1448
1767
|
/** {@link Disposable.dispose} */
|
|
1449
1768
|
dispose(): void;
|
|
1450
|
-
|
|
1451
|
-
|
|
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;
|
|
1769
|
+
private setupEvents;
|
|
1770
|
+
private updateZoom;
|
|
1459
1771
|
}
|
|
1460
1772
|
import * as THREE from "three";
|
|
1461
1773
|
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1462
1774
|
import { Components } from "../../Components";
|
|
1775
|
+
/**
|
|
1776
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
1777
|
+
*/
|
|
1463
1778
|
export interface SimpleSceneConfig {
|
|
1464
1779
|
directionalLight: {
|
|
1465
1780
|
color: THREE.Color;
|
|
@@ -1472,39 +1787,129 @@ export interface SimpleSceneConfig {
|
|
|
1472
1787
|
};
|
|
1473
1788
|
}
|
|
1474
1789
|
/**
|
|
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
|
|
1790
|
+
* 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
1791
|
*/
|
|
1479
1792
|
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1480
1793
|
/** {@link Configurable.isSetup} */
|
|
1481
1794
|
isSetup: boolean;
|
|
1795
|
+
/**
|
|
1796
|
+
* The underlying Three.js scene object.
|
|
1797
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
1798
|
+
*/
|
|
1482
1799
|
three: THREE.Scene;
|
|
1483
1800
|
/** {@link Configurable.onSetup} */
|
|
1484
1801
|
readonly onSetup: Event<SimpleScene>;
|
|
1802
|
+
/**
|
|
1803
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
1804
|
+
* Defines properties for directional and ambient lights.
|
|
1805
|
+
*/
|
|
1485
1806
|
config: Required<SimpleSceneConfig>;
|
|
1486
1807
|
constructor(components: Components);
|
|
1487
|
-
/**
|
|
1808
|
+
/** {@link Configurable.setup} */
|
|
1488
1809
|
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1489
1810
|
}
|
|
1490
1811
|
import * as THREE from "three";
|
|
1812
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
1813
|
+
/**
|
|
1814
|
+
* A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface.
|
|
1815
|
+
*
|
|
1816
|
+
* @template T - The type of the scene. Default is BaseScene.
|
|
1817
|
+
* @template U - The type of the camera. Default is BaseCamera.
|
|
1818
|
+
* @template S - The type of the renderer. Default is BaseRenderer.
|
|
1819
|
+
*/
|
|
1820
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World, Disposable, Updateable {
|
|
1821
|
+
/**
|
|
1822
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh). These meshes will be taken into account in operations like raycasting.
|
|
1823
|
+
*/
|
|
1824
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1825
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1826
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1827
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1828
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1829
|
+
/** {@link Disposable.onDisposed} */
|
|
1830
|
+
readonly onDisposed: Event<unknown>;
|
|
1831
|
+
/**
|
|
1832
|
+
* 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.
|
|
1833
|
+
*/
|
|
1834
|
+
isDisposing: boolean;
|
|
1835
|
+
/**
|
|
1836
|
+
* Indicates whether the world is currently enabled.
|
|
1837
|
+
* When disabled, the world will not be updated.
|
|
1838
|
+
*/
|
|
1839
|
+
enabled: boolean;
|
|
1840
|
+
/**
|
|
1841
|
+
* A unique identifier for the world.
|
|
1842
|
+
*/
|
|
1843
|
+
uuid: string;
|
|
1844
|
+
/**
|
|
1845
|
+
* An optional name for the world.
|
|
1846
|
+
*/
|
|
1847
|
+
name?: string;
|
|
1848
|
+
private _scene?;
|
|
1849
|
+
private _camera?;
|
|
1850
|
+
private _renderer;
|
|
1851
|
+
/**
|
|
1852
|
+
* Getter for the scene. If no scene is initialized, it throws an error.
|
|
1853
|
+
* @returns The current scene.
|
|
1854
|
+
*/
|
|
1855
|
+
get scene(): T;
|
|
1856
|
+
/**
|
|
1857
|
+
* Setter for the scene. It sets the current scene, adds the world to the scene's worlds set,
|
|
1858
|
+
* sets the current world in the scene, and triggers the scene's onWorldChanged event with the added action.
|
|
1859
|
+
* @param scene - The new scene to be set.
|
|
1860
|
+
*/
|
|
1861
|
+
set scene(scene: T);
|
|
1862
|
+
/**
|
|
1863
|
+
* Getter for the camera. If no camera is initialized, it throws an error.
|
|
1864
|
+
* @returns The current camera.
|
|
1865
|
+
*/
|
|
1866
|
+
get camera(): U;
|
|
1867
|
+
/**
|
|
1868
|
+
* Setter for the camera. It sets the current camera, adds the world to the camera's worlds set,
|
|
1869
|
+
* sets the current world in the camera, and triggers the camera's onWorldChanged event with the added action.
|
|
1870
|
+
* @param camera - The new camera to be set.
|
|
1871
|
+
*/
|
|
1872
|
+
set camera(camera: U);
|
|
1873
|
+
/**
|
|
1874
|
+
* Getter for the renderer.
|
|
1875
|
+
* @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).
|
|
1876
|
+
*/
|
|
1877
|
+
get renderer(): S | null;
|
|
1878
|
+
/**
|
|
1879
|
+
* Setter for the renderer. It sets the current renderer, adds the world to the renderer's worlds set,
|
|
1880
|
+
* sets the current world in the renderer, and triggers the renderer's onWorldChanged event with the added action.
|
|
1881
|
+
* If a new renderer is set, it also triggers the onWorldChanged event with the removed action for the old renderer.
|
|
1882
|
+
* @param renderer - The new renderer to be set or null to remove the current renderer.
|
|
1883
|
+
*/
|
|
1884
|
+
set renderer(renderer: S | null);
|
|
1885
|
+
/** {@link Updateable.update} */
|
|
1886
|
+
update(delta?: number): void;
|
|
1887
|
+
/** {@link Disposable.dispose} */
|
|
1888
|
+
dispose(disposeResources?: boolean): void;
|
|
1889
|
+
}
|
|
1890
|
+
import * as THREE from "three";
|
|
1491
1891
|
import CameraControls from "camera-controls";
|
|
1492
1892
|
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1493
1893
|
import { Components } from "../../Components";
|
|
1494
1894
|
/**
|
|
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.
|
|
1895
|
+
* 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
1896
|
*/
|
|
1500
1897
|
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1501
1898
|
/** {@link Updateable.onBeforeUpdate} */
|
|
1502
1899
|
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1503
1900
|
/** {@link Updateable.onAfterUpdate} */
|
|
1504
1901
|
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Event that is triggered when the aspect of the camera has been updated.
|
|
1904
|
+
* This event is useful when you need to perform actions after the aspect of the camera has been changed.
|
|
1905
|
+
*/
|
|
1505
1906
|
readonly onAspectUpdated: Event<unknown>;
|
|
1506
1907
|
/** {@link Disposable.onDisposed} */
|
|
1507
1908
|
readonly onDisposed: Event<string>;
|
|
1909
|
+
/**
|
|
1910
|
+
* A three.js PerspectiveCamera or OrthographicCamera instance.
|
|
1911
|
+
* This camera is used for rendering the scene.
|
|
1912
|
+
*/
|
|
1508
1913
|
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1509
1914
|
private _allControls;
|
|
1510
1915
|
/**
|
|
@@ -1514,9 +1919,20 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1514
1919
|
* object to move, rotate, look at objects, etc.
|
|
1515
1920
|
*/
|
|
1516
1921
|
get controls(): CameraControls;
|
|
1517
|
-
/**
|
|
1922
|
+
/**
|
|
1923
|
+
* Getter for the enabled state of the camera controls.
|
|
1924
|
+
* If the current world is null, it returns false.
|
|
1925
|
+
* Otherwise, it returns the enabled state of the camera controls.
|
|
1926
|
+
*
|
|
1927
|
+
* @returns {boolean} The enabled state of the camera controls.
|
|
1928
|
+
*/
|
|
1518
1929
|
get enabled(): boolean;
|
|
1519
|
-
/**
|
|
1930
|
+
/**
|
|
1931
|
+
* Setter for the enabled state of the camera controls.
|
|
1932
|
+
* If the current world is not null, it sets the enabled state of the camera controls to the provided value.
|
|
1933
|
+
*
|
|
1934
|
+
* @param {boolean} enabled - The new enabled state of the camera controls.
|
|
1935
|
+
*/
|
|
1520
1936
|
set enabled(enabled: boolean);
|
|
1521
1937
|
constructor(components: Components);
|
|
1522
1938
|
/** {@link Disposable.dispose} */
|
|
@@ -1534,60 +1950,169 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1534
1950
|
private static getSubsetOfThree;
|
|
1535
1951
|
}
|
|
1536
1952
|
import * as THREE from "three";
|
|
1537
|
-
import {
|
|
1953
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1538
1954
|
import { Components } from "../../Components";
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1955
|
+
/**
|
|
1956
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1957
|
+
*/
|
|
1958
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1959
|
+
/**
|
|
1960
|
+
* Indicates whether the renderer is enabled. If it's not, it won't be updated.
|
|
1961
|
+
* Default is 'true'.
|
|
1962
|
+
*/
|
|
1963
|
+
enabled: boolean;
|
|
1964
|
+
/**
|
|
1965
|
+
* The HTML container of the THREE.js canvas where the scene is rendered.
|
|
1966
|
+
*/
|
|
1967
|
+
container: HTMLElement;
|
|
1968
|
+
/**
|
|
1969
|
+
* The THREE.js WebGLRenderer instance.
|
|
1970
|
+
*/
|
|
1971
|
+
three: THREE.WebGLRenderer;
|
|
1972
|
+
protected _canvas: HTMLCanvasElement;
|
|
1973
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1974
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1975
|
+
protected onContainerUpdated: Event<unknown>;
|
|
1976
|
+
private _resizing;
|
|
1977
|
+
/**
|
|
1978
|
+
* Constructor for the SimpleRenderer class.
|
|
1979
|
+
*
|
|
1980
|
+
* @param components - The components instance.
|
|
1981
|
+
* @param container - The HTML container where the THREE.js canvas will be rendered.
|
|
1982
|
+
* @param parameters - Optional parameters for the THREE.js WebGLRenderer.
|
|
1983
|
+
*/
|
|
1984
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1985
|
+
/** {@link Updateable.update} */
|
|
1986
|
+
update(): void;
|
|
1987
|
+
/** {@link Disposable.dispose} */
|
|
1988
|
+
dispose(): void;
|
|
1989
|
+
/** {@link Resizeable.getSize}. */
|
|
1990
|
+
getSize(): THREE.Vector2;
|
|
1991
|
+
/** {@link Resizeable.resize} */
|
|
1992
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1993
|
+
/**
|
|
1994
|
+
* Sets up and manages the event listeners for the renderer.
|
|
1995
|
+
*
|
|
1996
|
+
* @param active - A boolean indicating whether to activate or deactivate the event listeners.
|
|
1997
|
+
*
|
|
1998
|
+
* @throws Will throw an error if the renderer does not have an HTML container.
|
|
1999
|
+
*/
|
|
2000
|
+
setupEvents(active: boolean): void;
|
|
2001
|
+
private resizeEvent;
|
|
2002
|
+
private setupRenderer;
|
|
2003
|
+
private onContextLost;
|
|
2004
|
+
private onContextBack;
|
|
1544
2005
|
}
|
|
2006
|
+
import * as THREE from "three";
|
|
2007
|
+
import { Disposable, Event } from "../../Types";
|
|
1545
2008
|
/**
|
|
1546
|
-
*
|
|
1547
|
-
*
|
|
1548
|
-
*
|
|
1549
|
-
*
|
|
2009
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
2010
|
+
* to work with tools like the
|
|
2011
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
2012
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1550
2013
|
*/
|
|
1551
|
-
export declare class
|
|
2014
|
+
export declare class Mouse implements Disposable {
|
|
2015
|
+
dom: HTMLCanvasElement;
|
|
2016
|
+
private _event?;
|
|
2017
|
+
private _position;
|
|
1552
2018
|
/** {@link Disposable.onDisposed} */
|
|
1553
2019
|
readonly onDisposed: Event<unknown>;
|
|
1554
|
-
|
|
2020
|
+
constructor(dom: HTMLCanvasElement);
|
|
2021
|
+
/**
|
|
2022
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2023
|
+
*/
|
|
2024
|
+
get position(): THREE.Vector2;
|
|
2025
|
+
/** {@link Disposable.dispose} */
|
|
2026
|
+
dispose(): void;
|
|
2027
|
+
private getPositionY;
|
|
2028
|
+
private getPositionX;
|
|
2029
|
+
private updateMouseInfo;
|
|
2030
|
+
private setupEvents;
|
|
2031
|
+
}
|
|
2032
|
+
import * as THREE from "three";
|
|
2033
|
+
import { Components } from "../../Components";
|
|
2034
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2035
|
+
import { Mouse } from "./mouse";
|
|
2036
|
+
/**
|
|
2037
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
2038
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
2039
|
+
* events.
|
|
2040
|
+
*/
|
|
2041
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2042
|
+
/** {@link Component.enabled} */
|
|
2043
|
+
enabled: boolean;
|
|
2044
|
+
/** The components instance to which this Raycaster belongs. */
|
|
1555
2045
|
components: Components;
|
|
1556
|
-
/** {@link
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
|
|
1560
|
-
/** The material of the grid. */
|
|
1561
|
-
get material(): THREE.ShaderMaterial;
|
|
2046
|
+
/** {@link Disposable.onDisposed} */
|
|
2047
|
+
readonly onDisposed: Event<unknown>;
|
|
2048
|
+
/** The position of the mouse in the screen. */
|
|
2049
|
+
readonly mouse: Mouse;
|
|
1562
2050
|
/**
|
|
1563
|
-
*
|
|
1564
|
-
*
|
|
2051
|
+
* A reference to the Three.js Raycaster instance.
|
|
2052
|
+
* This is used for raycasting operations.
|
|
1565
2053
|
*/
|
|
1566
|
-
|
|
2054
|
+
readonly three: THREE.Raycaster;
|
|
1567
2055
|
/**
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
2056
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2057
|
+
* This is used to access the camera and meshes.
|
|
1570
2058
|
*/
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
private _fade;
|
|
1574
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
2059
|
+
world: World;
|
|
2060
|
+
constructor(components: Components, world: World);
|
|
1575
2061
|
/** {@link Disposable.dispose} */
|
|
1576
2062
|
dispose(): void;
|
|
1577
|
-
|
|
1578
|
-
|
|
2063
|
+
/**
|
|
2064
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2065
|
+
* the first item found. This also takes into account the clipping planes
|
|
2066
|
+
* used by the renderer.
|
|
2067
|
+
*
|
|
2068
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2069
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2070
|
+
* {@link Components.meshes}.
|
|
2071
|
+
*/
|
|
2072
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2073
|
+
/**
|
|
2074
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2075
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2076
|
+
*
|
|
2077
|
+
* @param origin - The origin of the ray.
|
|
2078
|
+
* @param direction - The direction of the ray.
|
|
2079
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2080
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2081
|
+
*/
|
|
2082
|
+
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;
|
|
2083
|
+
private intersect;
|
|
2084
|
+
private filterClippingPlanes;
|
|
1579
2085
|
}
|
|
1580
2086
|
import * as THREE from "three";
|
|
1581
2087
|
import { Components } from "../../Components";
|
|
1582
2088
|
import { AsyncEvent, Event, World } from "../../Types";
|
|
2089
|
+
/**
|
|
2090
|
+
* Interface for settings to configure the CullerRenderer.
|
|
2091
|
+
*/
|
|
1583
2092
|
export interface CullerRendererSettings {
|
|
2093
|
+
/**
|
|
2094
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
2095
|
+
* Default value is 1000.
|
|
2096
|
+
*/
|
|
1584
2097
|
updateInterval?: number;
|
|
2098
|
+
/**
|
|
2099
|
+
* Width of the render target used for visibility checks.
|
|
2100
|
+
* Default value is 512.
|
|
2101
|
+
*/
|
|
1585
2102
|
width?: number;
|
|
2103
|
+
/**
|
|
2104
|
+
* Height of the render target used for visibility checks.
|
|
2105
|
+
* Default value is 512.
|
|
2106
|
+
*/
|
|
1586
2107
|
height?: number;
|
|
2108
|
+
/**
|
|
2109
|
+
* Whether the visibility check should be performed automatically.
|
|
2110
|
+
* Default value is true.
|
|
2111
|
+
*/
|
|
1587
2112
|
autoUpdate?: boolean;
|
|
1588
2113
|
}
|
|
1589
2114
|
/**
|
|
1590
|
-
* A base renderer to determine visibility on screen
|
|
2115
|
+
* A base renderer to determine visibility on screen.
|
|
1591
2116
|
*/
|
|
1592
2117
|
export declare class CullerRenderer {
|
|
1593
2118
|
/** {@link Disposable.onDisposed} */
|
|
@@ -1598,7 +2123,9 @@ export declare class CullerRenderer {
|
|
|
1598
2123
|
* just before but not anymore.
|
|
1599
2124
|
*/
|
|
1600
2125
|
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1601
|
-
/**
|
|
2126
|
+
/**
|
|
2127
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2128
|
+
*/
|
|
1602
2129
|
enabled: boolean;
|
|
1603
2130
|
/**
|
|
1604
2131
|
* Needs to check whether there are objects that need to be hidden or shown.
|
|
@@ -1610,8 +2137,11 @@ export declare class CullerRenderer {
|
|
|
1610
2137
|
* for debugging purposes.
|
|
1611
2138
|
*/
|
|
1612
2139
|
renderDebugFrame: boolean;
|
|
2140
|
+
/** The components instance to which this renderer belongs. */
|
|
1613
2141
|
components: Components;
|
|
2142
|
+
/** The world instance to which this renderer belongs. */
|
|
1614
2143
|
readonly world: World;
|
|
2144
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
1615
2145
|
readonly renderer: THREE.WebGLRenderer;
|
|
1616
2146
|
protected autoUpdate: boolean;
|
|
1617
2147
|
protected updateInterval: number;
|
|
@@ -1630,214 +2160,81 @@ export declare class CullerRenderer {
|
|
|
1630
2160
|
/**
|
|
1631
2161
|
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1632
2162
|
* better to call needsUpdate, but you can also call this to force it.
|
|
1633
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1634
|
-
* not true.
|
|
1635
|
-
*/
|
|
1636
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1637
|
-
protected getAvailableColor(): {
|
|
1638
|
-
r: number;
|
|
1639
|
-
g: number;
|
|
1640
|
-
b: number;
|
|
1641
|
-
code: string;
|
|
1642
|
-
};
|
|
1643
|
-
protected increaseColor(): void;
|
|
1644
|
-
protected decreaseColor(): void;
|
|
1645
|
-
private applySettings;
|
|
1646
|
-
}
|
|
1647
|
-
import * as THREE from "three";
|
|
1648
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1649
|
-
import { Components } from "../../Components";
|
|
1650
|
-
import { Event, World } from "../../Types";
|
|
1651
|
-
/**
|
|
1652
|
-
* A renderer to determine a mesh visibility on screen
|
|
1653
|
-
*/
|
|
1654
|
-
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
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;
|
|
2163
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2164
|
+
* not true.
|
|
2165
|
+
*/
|
|
2166
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
2167
|
+
protected getAvailableColor(): {
|
|
2168
|
+
r: number;
|
|
2169
|
+
g: number;
|
|
2170
|
+
b: number;
|
|
2171
|
+
code: string;
|
|
1718
2172
|
};
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
geometries: {
|
|
1723
|
-
geometryID: number;
|
|
1724
|
-
transformation: number[];
|
|
1725
|
-
color: number[];
|
|
1726
|
-
}[];
|
|
2173
|
+
protected increaseColor(): void;
|
|
2174
|
+
protected decreaseColor(): void;
|
|
2175
|
+
private applySettings;
|
|
1727
2176
|
}
|
|
1728
2177
|
import * as THREE from "three";
|
|
1729
|
-
import {
|
|
2178
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1730
2179
|
import { Components } from "../../Components";
|
|
2180
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1731
2181
|
/**
|
|
1732
|
-
*
|
|
2182
|
+
* A renderer to determine a mesh visibility on screen.
|
|
1733
2183
|
*/
|
|
1734
|
-
export declare class
|
|
1735
|
-
/**
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
/** The material of the clipping plane representation. */
|
|
1766
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1767
|
-
/** The size of the clipping plane representation. */
|
|
1768
|
-
get size(): number;
|
|
1769
|
-
/** Sets the size of the clipping plane representation. */
|
|
1770
|
-
set size(size: number);
|
|
1771
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1772
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1773
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
1774
|
-
/** {@link Updateable.update} */
|
|
1775
|
-
update: () => void;
|
|
2184
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2185
|
+
/**
|
|
2186
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2187
|
+
* Contains two sets: seen and unseen.
|
|
2188
|
+
*/
|
|
2189
|
+
readonly onViewUpdated: Event<{
|
|
2190
|
+
seen: Set<THREE.Mesh>;
|
|
2191
|
+
unseen: Set<THREE.Mesh>;
|
|
2192
|
+
}>;
|
|
2193
|
+
/**
|
|
2194
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2195
|
+
* Default value is 100.
|
|
2196
|
+
*/
|
|
2197
|
+
threshold: number;
|
|
2198
|
+
/**
|
|
2199
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2200
|
+
* Used to keep track of color-coded meshes.
|
|
2201
|
+
*/
|
|
2202
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2203
|
+
/**
|
|
2204
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2205
|
+
* Used to prevent concurrent processing.
|
|
2206
|
+
*/
|
|
2207
|
+
isProcessing: boolean;
|
|
2208
|
+
private _colorCodeMeshMap;
|
|
2209
|
+
private _meshIDColorCodeMap;
|
|
2210
|
+
private _currentVisibleMeshes;
|
|
2211
|
+
private _recentlyHiddenMeshes;
|
|
2212
|
+
private _intervalID;
|
|
2213
|
+
private readonly _transparentMat;
|
|
2214
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1776
2215
|
/** {@link Disposable.dispose} */
|
|
1777
2216
|
dispose(): void;
|
|
1778
|
-
private reset;
|
|
1779
|
-
protected toggleControls(state: boolean): void;
|
|
1780
|
-
private newTransformControls;
|
|
1781
|
-
private initializeControls;
|
|
1782
|
-
private createArrowBoundingBox;
|
|
1783
|
-
private changeDrag;
|
|
1784
|
-
private notifyDraggingChanged;
|
|
1785
|
-
private preventCameraMovement;
|
|
1786
|
-
private newHelper;
|
|
1787
|
-
private static newPlaneMesh;
|
|
1788
|
-
}
|
|
1789
|
-
import * as WEBIFC from "web-ifc";
|
|
1790
|
-
export declare class IfcMetadataReader {
|
|
1791
|
-
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1792
|
-
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
1793
|
-
}
|
|
1794
|
-
import * as WEBIFC from "web-ifc";
|
|
1795
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
1796
|
-
export declare class IfcFragmentSettings {
|
|
1797
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
1798
|
-
includeProperties: boolean;
|
|
1799
2217
|
/**
|
|
1800
|
-
*
|
|
1801
|
-
*
|
|
2218
|
+
* 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.
|
|
2219
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2220
|
+
* @returns {void}
|
|
1802
2221
|
*/
|
|
1803
|
-
|
|
1804
|
-
/**
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
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
|
-
}
|
|
1821
|
-
import * as THREE from "three";
|
|
1822
|
-
import * as WEBIFC from "web-ifc";
|
|
1823
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1824
|
-
export declare class CivilReader {
|
|
1825
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1826
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1827
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1828
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1829
|
-
} | undefined;
|
|
1830
|
-
get(civilItems: any): {
|
|
1831
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1832
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1833
|
-
} | undefined;
|
|
1834
|
-
private getCurves;
|
|
2222
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2223
|
+
/**
|
|
2224
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2225
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2226
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2227
|
+
* @returns {void}
|
|
2228
|
+
*/
|
|
2229
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2230
|
+
private handleWorkerMessage;
|
|
2231
|
+
private getAvailableMaterial;
|
|
1835
2232
|
}
|
|
2233
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1836
2234
|
import { NavigationMode } from "./types";
|
|
1837
2235
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1838
2236
|
/**
|
|
1839
|
-
* A {@link NavigationMode} that allows first person navigation,
|
|
1840
|
-
* simulating FPS video games.
|
|
2237
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
1841
2238
|
*/
|
|
1842
2239
|
export declare class FirstPersonMode implements NavigationMode {
|
|
1843
2240
|
private camera;
|
|
@@ -1853,8 +2250,7 @@ export declare class FirstPersonMode implements NavigationMode {
|
|
|
1853
2250
|
import { NavigationMode } from "./types";
|
|
1854
2251
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1855
2252
|
/**
|
|
1856
|
-
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1857
|
-
* like in many 3D and CAD softwares.
|
|
2253
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
1858
2254
|
*/
|
|
1859
2255
|
export declare class OrbitMode implements NavigationMode {
|
|
1860
2256
|
camera: OrthoPerspectiveCamera;
|
|
@@ -1870,8 +2266,7 @@ export declare class OrbitMode implements NavigationMode {
|
|
|
1870
2266
|
import { NavigationMode } from "./types";
|
|
1871
2267
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1872
2268
|
/**
|
|
1873
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1874
|
-
* like many BIM tools.
|
|
2269
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
1875
2270
|
*/
|
|
1876
2271
|
export declare class PlanMode implements NavigationMode {
|
|
1877
2272
|
private camera;
|
|
@@ -1900,12 +2295,20 @@ export declare class ProjectionManager {
|
|
|
1900
2295
|
* Event that fires when the {@link CameraProjection} changes.
|
|
1901
2296
|
*/
|
|
1902
2297
|
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2298
|
+
/**
|
|
2299
|
+
* Current projection mode of the camera.
|
|
2300
|
+
* Default is "Perspective".
|
|
2301
|
+
*/
|
|
1903
2302
|
current: CameraProjection;
|
|
2303
|
+
/**
|
|
2304
|
+
* The camera controlled by this ProjectionManager.
|
|
2305
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
2306
|
+
*/
|
|
1904
2307
|
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1905
|
-
private _component;
|
|
1906
|
-
private _previousDistance;
|
|
1907
2308
|
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1908
2309
|
matchOrthoDistanceEnabled: boolean;
|
|
2310
|
+
private _component;
|
|
2311
|
+
private _previousDistance;
|
|
1909
2312
|
constructor(camera: OrthoPerspectiveCamera);
|
|
1910
2313
|
/**
|
|
1911
2314
|
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
@@ -1934,8 +2337,7 @@ export type CameraProjection = "Perspective" | "Orthographic";
|
|
|
1934
2337
|
*/
|
|
1935
2338
|
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1936
2339
|
/**
|
|
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).
|
|
2340
|
+
* 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
2341
|
*/
|
|
1940
2342
|
export interface NavigationMode {
|
|
1941
2343
|
/** The unique ID of this navigation mode. */
|
|
@@ -1952,6 +2354,105 @@ export interface NavigationMode {
|
|
|
1952
2354
|
/** Whether this navigation mode is active or not. */
|
|
1953
2355
|
enabled: boolean;
|
|
1954
2356
|
}
|
|
2357
|
+
import * as THREE from "three";
|
|
2358
|
+
import * as WEBIFC from "web-ifc";
|
|
2359
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
2360
|
+
export declare class CivilReader {
|
|
2361
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
2362
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
2363
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
2364
|
+
coordinationMatrix: THREE.Matrix4;
|
|
2365
|
+
} | undefined;
|
|
2366
|
+
get(civilItems: any): {
|
|
2367
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
2368
|
+
coordinationMatrix: THREE.Matrix4;
|
|
2369
|
+
} | undefined;
|
|
2370
|
+
private getCurves;
|
|
2371
|
+
}
|
|
2372
|
+
import * as WEBIFC from "web-ifc";
|
|
2373
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2374
|
+
export declare class IfcFragmentSettings {
|
|
2375
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2376
|
+
includeProperties: boolean;
|
|
2377
|
+
/**
|
|
2378
|
+
* Generate the geometry for categories that are not included by default,
|
|
2379
|
+
* like IFCSPACE.
|
|
2380
|
+
*/
|
|
2381
|
+
optionalCategories: number[];
|
|
2382
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2383
|
+
coordinate: boolean;
|
|
2384
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2385
|
+
wasm: {
|
|
2386
|
+
path: string;
|
|
2387
|
+
absolute: boolean;
|
|
2388
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2389
|
+
};
|
|
2390
|
+
/** List of categories that won't be converted to fragments. */
|
|
2391
|
+
excludedCategories: Set<number>;
|
|
2392
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2393
|
+
saveLocations: boolean;
|
|
2394
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2395
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2396
|
+
autoSetWasm: boolean;
|
|
2397
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2398
|
+
}
|
|
2399
|
+
import * as WEBIFC from "web-ifc";
|
|
2400
|
+
export declare class IfcMetadataReader {
|
|
2401
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2402
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
2403
|
+
}
|
|
2404
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2405
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
2406
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
2407
|
+
minGeometrySize: number;
|
|
2408
|
+
minAssetsSize: number;
|
|
2409
|
+
}
|
|
2410
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
2411
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
2412
|
+
propertiesSize: number;
|
|
2413
|
+
}
|
|
2414
|
+
export interface StreamedGeometries {
|
|
2415
|
+
[id: number]: {
|
|
2416
|
+
boundingBox: Float32Array;
|
|
2417
|
+
hasHoles: boolean;
|
|
2418
|
+
geometryFile?: string;
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
export interface StreamedAsset {
|
|
2422
|
+
id: number;
|
|
2423
|
+
geometries: {
|
|
2424
|
+
geometryID: number;
|
|
2425
|
+
transformation: number[];
|
|
2426
|
+
color: number[];
|
|
2427
|
+
}[];
|
|
2428
|
+
}
|
|
2429
|
+
import * as WEBIFC from "web-ifc";
|
|
2430
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
2431
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
2432
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
2433
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
2434
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
2435
|
+
type: number;
|
|
2436
|
+
data: {
|
|
2437
|
+
[id: number]: any;
|
|
2438
|
+
};
|
|
2439
|
+
}>;
|
|
2440
|
+
onProgress: AsyncEvent<number>;
|
|
2441
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
2442
|
+
/** {@link Disposable.onDisposed} */
|
|
2443
|
+
readonly onDisposed: Event<string>;
|
|
2444
|
+
enabled: boolean;
|
|
2445
|
+
settings: PropertiesStreamingSettings;
|
|
2446
|
+
webIfc: WEBIFC.IfcAPI;
|
|
2447
|
+
dispose(): Promise<void>;
|
|
2448
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
2449
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
2450
|
+
private readIfcFile;
|
|
2451
|
+
private streamIfcFile;
|
|
2452
|
+
private streamAllProperties;
|
|
2453
|
+
private getIndices;
|
|
2454
|
+
private cleanUp;
|
|
2455
|
+
}
|
|
1955
2456
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1956
2457
|
export interface ModelsRelationMap {
|
|
1957
2458
|
[modelID: string]: RelationsMap;
|