@thatopen/components 2.0.14 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +224 -161
- package/dist/namespace.d.ts +1910 -1826
- package/dist/utils/vertex-picker.d.ts +92 -8
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,602 +1,644 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import { Component, Disposable, Event
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class Components implements Disposable {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* This UUID is used to register the component within the Components system.
|
|
8
|
+
* The version of the @thatopen/components library.
|
|
10
9
|
*/
|
|
11
|
-
static readonly
|
|
10
|
+
static readonly release = "2.0.14";
|
|
12
11
|
/** {@link Disposable.onDisposed} */
|
|
13
|
-
readonly onDisposed: Event<
|
|
14
|
-
/**
|
|
12
|
+
readonly onDisposed: Event<void>;
|
|
13
|
+
/**
|
|
14
|
+
* The list of components created in this app.
|
|
15
|
+
* The keys are UUIDs and the values are instances of the components.
|
|
16
|
+
*/
|
|
17
|
+
readonly list: Map<string, Component>;
|
|
18
|
+
/**
|
|
19
|
+
* If disabled, the animation loop will be stopped.
|
|
20
|
+
* Default value is false.
|
|
21
|
+
*/
|
|
15
22
|
enabled: boolean;
|
|
23
|
+
private _clock;
|
|
16
24
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
25
|
+
* Adds a component to the list of components.
|
|
26
|
+
* Throws an error if a component with the same UUID already exists.
|
|
27
|
+
*
|
|
28
|
+
* @param uuid - The unique identifier of the component.
|
|
29
|
+
* @param instance - The instance of the component to be added.
|
|
30
|
+
*
|
|
31
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
20
34
|
*/
|
|
21
|
-
|
|
35
|
+
add(uuid: string, instance: Component): void;
|
|
22
36
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
37
|
+
* Retrieves a component instance by its constructor function.
|
|
38
|
+
* If the component does not exist in the list, it will be created and added.
|
|
39
|
+
*
|
|
40
|
+
* @template U - The type of the component to retrieve.
|
|
41
|
+
* @param Component - The constructor function of the component to retrieve.
|
|
42
|
+
*
|
|
43
|
+
* @returns The instance of the requested component.
|
|
44
|
+
*
|
|
45
|
+
* @throws Will throw an error if a component with the same UUID already exists.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
26
48
|
*/
|
|
27
|
-
|
|
49
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
50
|
+
constructor();
|
|
28
51
|
/**
|
|
29
|
-
*
|
|
30
|
-
* This
|
|
52
|
+
* Initializes the Components instance.
|
|
53
|
+
* This method starts the animation loop, sets the enabled flag to true,
|
|
54
|
+
* and calls the update method.
|
|
55
|
+
*
|
|
56
|
+
* @returns {void}
|
|
31
57
|
*/
|
|
32
|
-
|
|
33
|
-
constructor(components: Components);
|
|
34
|
-
/** {@link Disposable.dispose} */
|
|
35
|
-
dispose(): void;
|
|
58
|
+
init(): void;
|
|
36
59
|
/**
|
|
37
|
-
*
|
|
60
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
61
|
+
* the library. A memory leak will be created if:
|
|
38
62
|
*
|
|
39
|
-
*
|
|
63
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
64
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
65
|
+
* Angular, Vue, etc).
|
|
40
66
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
44
|
-
* If 'active' is false, the fragments are moved back to their original position.
|
|
67
|
+
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
68
|
+
* referenced by a reference type (object or array).
|
|
45
69
|
*
|
|
46
|
-
*
|
|
70
|
+
* You can learn more about how Three.js handles memory leaks
|
|
71
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
47
72
|
*
|
|
48
|
-
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
49
73
|
*/
|
|
50
|
-
|
|
74
|
+
dispose(): void;
|
|
75
|
+
private update;
|
|
76
|
+
private static setupBVH;
|
|
51
77
|
}
|
|
52
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
53
78
|
import * as THREE from "three";
|
|
54
|
-
import
|
|
55
|
-
import { Component
|
|
56
|
-
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
79
|
+
import { Components } from "../Components";
|
|
80
|
+
import { Component } from "../Types";
|
|
57
81
|
/**
|
|
58
|
-
*
|
|
82
|
+
* A tool to safely remove meshes, geometries, materials and other items from memory to [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
59
83
|
*/
|
|
60
|
-
export declare class
|
|
84
|
+
export declare class Disposer extends Component {
|
|
85
|
+
private _disposedComponents;
|
|
86
|
+
/** {@link Component.enabled} */
|
|
87
|
+
enabled: boolean;
|
|
61
88
|
/**
|
|
62
89
|
* A unique identifier for the component.
|
|
63
90
|
* This UUID is used to register the component within the Components system.
|
|
64
91
|
*/
|
|
65
|
-
static readonly uuid: "
|
|
66
|
-
|
|
67
|
-
readonly onDisposed: Event<unknown>;
|
|
68
|
-
/**
|
|
69
|
-
* Event triggered when fragments are loaded.
|
|
70
|
-
*/
|
|
71
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
72
|
-
/**
|
|
73
|
-
* Event triggered when fragments are disposed.
|
|
74
|
-
*/
|
|
75
|
-
readonly onFragmentsDisposed: Event<{
|
|
76
|
-
groupID: string;
|
|
77
|
-
fragmentIDs: string[];
|
|
78
|
-
}>;
|
|
92
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
93
|
+
constructor(components: Components);
|
|
79
94
|
/**
|
|
80
|
-
*
|
|
81
|
-
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
95
|
+
* Return the UUIDs of all disposed components.
|
|
82
96
|
*/
|
|
83
|
-
|
|
97
|
+
get(): Set<string>;
|
|
84
98
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
99
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
100
|
+
* using any of these in other parts of the application, make sure that you
|
|
101
|
+
* remove them from the mesh before disposing it.
|
|
102
|
+
*
|
|
103
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
104
|
+
* to remove.
|
|
105
|
+
*
|
|
106
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
107
|
+
*
|
|
108
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
87
109
|
*/
|
|
88
|
-
|
|
89
|
-
baseCoordinationModel: string;
|
|
90
|
-
/** {@link Component.enabled} */
|
|
91
|
-
enabled: boolean;
|
|
92
|
-
private _loader;
|
|
110
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
93
111
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @
|
|
112
|
+
* Disposes a geometry from memory.
|
|
113
|
+
*
|
|
114
|
+
* @param geometry - the
|
|
115
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
116
|
+
* to remove.
|
|
97
117
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
118
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
119
|
+
private disposeGeometryAndMaterials;
|
|
120
|
+
private disposeChildren;
|
|
121
|
+
private static disposeMaterial;
|
|
122
|
+
}
|
|
123
|
+
import * as THREE from "three";
|
|
124
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
125
|
+
import { SimplePlane } from "./src";
|
|
126
|
+
import { Components } from "../Components";
|
|
127
|
+
/**
|
|
128
|
+
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
129
|
+
*
|
|
130
|
+
* @param components - the instance of {@link Components} used.
|
|
131
|
+
* E.g. {@link SimplePlane}.
|
|
132
|
+
*/
|
|
133
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
102
134
|
/**
|
|
103
|
-
*
|
|
104
|
-
* This
|
|
105
|
-
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
106
|
-
*
|
|
107
|
-
* @param group - The fragment group to be disposed.
|
|
135
|
+
* A unique identifier for the component.
|
|
136
|
+
* This UUID is used to register the component within the Components system.
|
|
108
137
|
*/
|
|
109
|
-
|
|
138
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
139
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
140
|
+
readonly onBeforeDrag: Event<void>;
|
|
141
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
142
|
+
readonly onAfterDrag: Event<void>;
|
|
110
143
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @param data - The binary data to load.
|
|
113
|
-
* @param config - Optional configuration for loading.
|
|
114
|
-
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
115
|
-
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
116
|
-
* @returns The loaded FragmentsGroup.
|
|
144
|
+
* Event that fires when the user starts creating a clipping plane.
|
|
117
145
|
*/
|
|
118
|
-
|
|
119
|
-
coordinate: boolean;
|
|
120
|
-
name: string;
|
|
121
|
-
properties: FRAGS.IfcProperties;
|
|
122
|
-
relationsMap: RelationsMap;
|
|
123
|
-
}>): FragmentsGroup;
|
|
146
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
124
147
|
/**
|
|
125
|
-
*
|
|
126
|
-
* @param group - the fragments group to be exported.
|
|
127
|
-
* @returns the exported data as binary buffer.
|
|
148
|
+
* Event that fires when the user cancels the creation of a clipping plane.
|
|
128
149
|
*/
|
|
129
|
-
|
|
150
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
130
151
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
133
|
-
* @returns A map of model IDs to sets of express IDs.
|
|
152
|
+
* Event that fires after the user cancels the creation of a clipping plane.
|
|
134
153
|
*/
|
|
135
|
-
|
|
136
|
-
[modelID: string]: Set<number>;
|
|
137
|
-
};
|
|
154
|
+
readonly onAfterCancel: Event<unknown>;
|
|
138
155
|
/**
|
|
139
|
-
*
|
|
140
|
-
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
141
|
-
* @returns A fragment ID map.
|
|
142
|
-
* @remarks
|
|
143
|
-
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
144
|
-
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
145
|
-
* The fragment ID maps are then merged into a single map and returned.
|
|
146
|
-
* 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.
|
|
156
|
+
* Event that fires when the user starts deleting a clipping plane.
|
|
147
157
|
*/
|
|
148
|
-
|
|
149
|
-
[modelID: string]: Set<number>;
|
|
150
|
-
}): FRAGS.FragmentIdMap;
|
|
158
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
151
159
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* The first model in the list becomes the base model for coordinate transformation.
|
|
155
|
-
* All other models are then transformed to match the base model's coordinate system.
|
|
156
|
-
*
|
|
157
|
-
* @param models - The models to apply coordinate transformation to.
|
|
158
|
-
* If not provided, all groups are used.
|
|
159
|
-
*
|
|
160
|
-
* @returns {void}
|
|
160
|
+
* Event that fires after a clipping plane has been created.
|
|
161
|
+
* @param plane - The newly created clipping plane.
|
|
161
162
|
*/
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
import * as WEBIFC from "web-ifc";
|
|
165
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
166
|
-
import { IfcFragmentSettings } from "./src";
|
|
167
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
168
|
-
/**
|
|
169
|
-
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
170
|
-
*/
|
|
171
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
163
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
172
164
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
165
|
+
* Event that fires after a clipping plane has been deleted.
|
|
166
|
+
* @param plane - The deleted clipping plane.
|
|
175
167
|
*/
|
|
176
|
-
|
|
168
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
177
169
|
/** {@link Disposable.onDisposed} */
|
|
178
170
|
readonly onDisposed: Event<string>;
|
|
179
171
|
/**
|
|
180
|
-
*
|
|
172
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
173
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
174
|
+
* clipping plane is created in its roof, which might have a slight
|
|
175
|
+
* slope for draining purposes.
|
|
181
176
|
*/
|
|
182
|
-
|
|
177
|
+
orthogonalY: boolean;
|
|
183
178
|
/**
|
|
184
|
-
*
|
|
179
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
180
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
181
|
+
* has to be 'true' for this to apply.
|
|
185
182
|
*/
|
|
186
|
-
|
|
183
|
+
toleranceOrthogonalY: number;
|
|
187
184
|
/**
|
|
188
|
-
* The
|
|
189
|
-
*
|
|
185
|
+
* The type of clipping plane to be created.
|
|
186
|
+
* Default is {@link SimplePlane}.
|
|
190
187
|
*/
|
|
191
|
-
|
|
188
|
+
Type: new (...args: any) => SimplePlane;
|
|
192
189
|
/**
|
|
193
|
-
*
|
|
190
|
+
* A list of all the clipping planes created by this component.
|
|
194
191
|
*/
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
enabled: boolean;
|
|
192
|
+
list: SimplePlane[];
|
|
193
|
+
/** The material used in all the clipping planes. */
|
|
198
194
|
private _material;
|
|
199
|
-
private
|
|
200
|
-
private
|
|
201
|
-
private
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
195
|
+
private _size;
|
|
196
|
+
private _enabled;
|
|
197
|
+
private _visible;
|
|
198
|
+
/** {@link Component.enabled} */
|
|
199
|
+
get enabled(): boolean;
|
|
200
|
+
/** {@link Component.enabled} */
|
|
201
|
+
set enabled(state: boolean);
|
|
202
|
+
/** {@link Hideable.visible } */
|
|
203
|
+
get visible(): boolean;
|
|
204
|
+
/** {@link Hideable.visible } */
|
|
205
|
+
set visible(state: boolean);
|
|
206
|
+
/** The material of the clipping plane representation. */
|
|
207
|
+
get material(): THREE.MeshBasicMaterial;
|
|
208
|
+
/** The material of the clipping plane representation. */
|
|
209
|
+
set material(material: THREE.MeshBasicMaterial);
|
|
210
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
211
|
+
get size(): number;
|
|
212
|
+
/** The size of the geometric representation of the clippings planes. */
|
|
213
|
+
set size(size: number);
|
|
205
214
|
constructor(components: Components);
|
|
206
215
|
/** {@link Disposable.dispose} */
|
|
207
216
|
dispose(): void;
|
|
217
|
+
/** {@link Createable.create} */
|
|
218
|
+
create(world: World): void;
|
|
208
219
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
212
|
-
* If not provided, the existing settings will be used.
|
|
213
|
-
*
|
|
214
|
-
* @returns A Promise that resolves when the setup process is completed.
|
|
215
|
-
*
|
|
216
|
-
* @remarks
|
|
217
|
-
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
218
|
-
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
219
|
-
*
|
|
220
|
-
* @example
|
|
221
|
-
* '''typescript
|
|
222
|
-
* const ifcLoader = new IfcLoader(components);
|
|
223
|
-
* await ifcLoader.setup({ autoSetWasm: true });
|
|
224
|
-
* '''
|
|
225
|
-
*/
|
|
226
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
227
|
-
/**
|
|
228
|
-
* Loads an IFC file and processes it for 3D visualization.
|
|
229
|
-
*
|
|
230
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
231
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
232
|
-
*
|
|
233
|
-
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* '''typescript
|
|
237
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
238
|
-
* const group = await ifcLoader.load(ifcData);
|
|
239
|
-
* '''
|
|
240
|
-
*/
|
|
241
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
242
|
-
/**
|
|
243
|
-
* Reads an IFC file and initializes the Web-IFC library.
|
|
244
|
-
*
|
|
245
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
246
|
-
*
|
|
247
|
-
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
248
|
-
*
|
|
249
|
-
* @remarks
|
|
250
|
-
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
251
|
-
* It also opens the IFC model using the provided data and settings.
|
|
220
|
+
* Creates a plane in a certain place and with a certain orientation,
|
|
221
|
+
* without the need of the mouse.
|
|
252
222
|
*
|
|
253
|
-
* @
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* '''
|
|
223
|
+
* @param world - the world where this plane should be created.
|
|
224
|
+
* @param normal - the orientation of the clipping plane.
|
|
225
|
+
* @param point - the position of the clipping plane.
|
|
226
|
+
* navigation.
|
|
258
227
|
*/
|
|
259
|
-
|
|
228
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
260
229
|
/**
|
|
261
|
-
*
|
|
262
|
-
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
263
|
-
*
|
|
264
|
-
* @remarks
|
|
265
|
-
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
230
|
+
* {@link Createable.delete}
|
|
266
231
|
*
|
|
267
|
-
* @
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* ifcLoader.cleanUp();
|
|
271
|
-
* '''
|
|
232
|
+
* @param world - the world where the plane to delete is.
|
|
233
|
+
* @param plane - the plane to delete. If undefined, the first plane
|
|
234
|
+
* found under the cursor will be deleted.
|
|
272
235
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
private
|
|
277
|
-
private
|
|
236
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
237
|
+
/** Deletes all the existing clipping planes. */
|
|
238
|
+
deleteAll(): void;
|
|
239
|
+
private deletePlane;
|
|
240
|
+
private pickPlane;
|
|
241
|
+
private getAllPlaneMeshes;
|
|
242
|
+
private createPlaneFromIntersection;
|
|
243
|
+
private getWorldNormal;
|
|
244
|
+
private normalizePlaneDirectionY;
|
|
245
|
+
private newPlane;
|
|
246
|
+
private updateMaterialsAndPlanes;
|
|
247
|
+
private _onStartDragging;
|
|
248
|
+
private _onEndDragging;
|
|
278
249
|
}
|
|
279
|
-
import
|
|
280
|
-
import {
|
|
281
|
-
import {
|
|
250
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
251
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
252
|
+
import { Components } from "../Components";
|
|
282
253
|
/**
|
|
283
|
-
* A component that
|
|
254
|
+
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
284
255
|
*/
|
|
285
|
-
export declare class
|
|
256
|
+
export declare class Grids extends Component implements Disposable {
|
|
286
257
|
/**
|
|
287
258
|
* A unique identifier for the component.
|
|
288
259
|
* This UUID is used to register the component within the Components system.
|
|
289
260
|
*/
|
|
290
|
-
static readonly uuid: "
|
|
291
|
-
/**
|
|
292
|
-
* Event triggered when geometry is streamed.
|
|
293
|
-
* Contains the streamed geometry data and its buffer.
|
|
294
|
-
*/
|
|
295
|
-
readonly onGeometryStreamed: Event<{
|
|
296
|
-
buffer: Uint8Array;
|
|
297
|
-
data: StreamedGeometries;
|
|
298
|
-
}>;
|
|
299
|
-
/**
|
|
300
|
-
* Event triggered when assets are streamed.
|
|
301
|
-
* Contains the streamed assets.
|
|
302
|
-
*/
|
|
303
|
-
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
261
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
304
262
|
/**
|
|
305
|
-
*
|
|
306
|
-
* Contains the progress percentage.
|
|
263
|
+
* A map of world UUIDs to their corresponding grid instances.
|
|
307
264
|
*/
|
|
308
|
-
|
|
265
|
+
list: Map<string, SimpleGrid>;
|
|
309
266
|
/**
|
|
310
|
-
*
|
|
311
|
-
* Contains the loaded IFC file data.
|
|
267
|
+
* The default configuration for grid creation.
|
|
312
268
|
*/
|
|
313
|
-
|
|
269
|
+
config: Required<GridConfig>;
|
|
314
270
|
/** {@link Disposable.onDisposed} */
|
|
315
271
|
readonly onDisposed: Event<unknown>;
|
|
316
|
-
/**
|
|
317
|
-
* Settings for the IfcGeometryTiler.
|
|
318
|
-
*/
|
|
319
|
-
settings: IfcStreamingSettings;
|
|
320
272
|
/** {@link Component.enabled} */
|
|
321
273
|
enabled: boolean;
|
|
322
|
-
/**
|
|
323
|
-
* The WebIFC API instance used for IFC file processing.
|
|
324
|
-
*/
|
|
325
|
-
webIfc: WEBIFC.IfcAPI;
|
|
326
|
-
private _spatialTree;
|
|
327
|
-
private _metaData;
|
|
328
|
-
private _visitedGeometries;
|
|
329
|
-
private _streamSerializer;
|
|
330
|
-
private _geometries;
|
|
331
|
-
private _geometryCount;
|
|
332
|
-
private _civil;
|
|
333
|
-
private _groupSerializer;
|
|
334
|
-
private _assets;
|
|
335
|
-
private _meshesWithHoles;
|
|
336
274
|
constructor(components: Components);
|
|
337
|
-
/** {@link Disposable.dispose} */
|
|
338
|
-
dispose(): void;
|
|
339
275
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
343
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
276
|
+
* Creates a new grid for the given world.
|
|
277
|
+
* Throws an error if a grid already exists for the world.
|
|
344
278
|
*
|
|
345
|
-
* @
|
|
346
|
-
*
|
|
279
|
+
* @param world - The world to create the grid for.
|
|
280
|
+
* @returns The newly created grid.
|
|
347
281
|
*
|
|
348
|
-
* @
|
|
349
|
-
* '''typescript
|
|
350
|
-
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
351
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
352
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
353
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
354
|
-
* '''
|
|
282
|
+
* @throws Will throw an error if a grid already exists for the given world.
|
|
355
283
|
*/
|
|
356
|
-
|
|
284
|
+
create(world: World): SimpleGrid;
|
|
357
285
|
/**
|
|
358
|
-
*
|
|
286
|
+
* Deletes the grid associated with the given world.
|
|
287
|
+
* If a grid does not exist for the given world, this method does nothing.
|
|
359
288
|
*
|
|
360
|
-
* @param
|
|
361
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
289
|
+
* @param world - The world for which to delete the grid.
|
|
362
290
|
*
|
|
363
291
|
* @remarks
|
|
364
|
-
* This method
|
|
365
|
-
*
|
|
292
|
+
* This method will dispose of the grid and remove it from the internal list.
|
|
293
|
+
* If the world is disposed before calling this method, the grid will be automatically deleted.
|
|
366
294
|
*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
private streamAllGeometries;
|
|
371
|
-
private cleanUp;
|
|
372
|
-
private getMesh;
|
|
373
|
-
private getGeometry;
|
|
374
|
-
private streamAssets;
|
|
375
|
-
private streamGeometries;
|
|
295
|
+
delete(world: World): void;
|
|
296
|
+
/** {@link Disposable.dispose} */
|
|
297
|
+
dispose(): void;
|
|
376
298
|
}
|
|
377
|
-
import * as
|
|
378
|
-
import {
|
|
379
|
-
import {
|
|
299
|
+
import * as THREE from "three";
|
|
300
|
+
import { Components } from "../Components";
|
|
301
|
+
import { SimpleCamera } from "..";
|
|
302
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
380
303
|
/**
|
|
381
|
-
* A
|
|
304
|
+
* A flexible camera that uses [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/OrthoPerspectiveCamera). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/OrthoPerspectiveCamera).
|
|
382
305
|
*/
|
|
383
|
-
export declare class
|
|
306
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
384
307
|
/**
|
|
385
|
-
* A
|
|
386
|
-
* This UUID is used to register the component within the Components system.
|
|
308
|
+
* A ProjectionManager instance that manages the projection modes of the camera.
|
|
387
309
|
*/
|
|
388
|
-
|
|
310
|
+
readonly projection: ProjectionManager;
|
|
389
311
|
/**
|
|
390
|
-
*
|
|
391
|
-
*
|
|
312
|
+
* A THREE.OrthographicCamera instance that represents the orthographic camera.
|
|
313
|
+
* This camera is used when the projection mode is set to orthographic.
|
|
392
314
|
*/
|
|
393
|
-
readonly
|
|
394
|
-
type: number;
|
|
395
|
-
data: {
|
|
396
|
-
[id: number]: any;
|
|
397
|
-
};
|
|
398
|
-
}>;
|
|
399
|
-
/**
|
|
400
|
-
* An event that is triggered to indicate the progress of the streaming process.
|
|
401
|
-
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
402
|
-
*/
|
|
403
|
-
readonly onProgress: AsyncEvent<number>;
|
|
315
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
404
316
|
/**
|
|
405
|
-
*
|
|
406
|
-
*
|
|
317
|
+
* A THREE.PerspectiveCamera instance that represents the perspective camera.
|
|
318
|
+
* This camera is used when the projection mode is set to perspective.
|
|
407
319
|
*/
|
|
408
|
-
readonly
|
|
409
|
-
|
|
410
|
-
readonly
|
|
411
|
-
|
|
412
|
-
|
|
320
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
321
|
+
protected readonly _userInputButtons: any;
|
|
322
|
+
protected readonly _frustumSize = 50;
|
|
323
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
324
|
+
protected _mode: NavigationMode | null;
|
|
325
|
+
private previousSize;
|
|
413
326
|
/**
|
|
414
|
-
*
|
|
327
|
+
* Getter for the current navigation mode.
|
|
328
|
+
* Throws an error if the mode is not found or the camera is not initialized.
|
|
329
|
+
*
|
|
330
|
+
* @returns {NavigationMode} The current navigation mode.
|
|
331
|
+
*
|
|
332
|
+
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
415
333
|
*/
|
|
416
|
-
|
|
334
|
+
get mode(): NavigationMode;
|
|
335
|
+
constructor(components: Components);
|
|
336
|
+
/** {@link Disposable.dispose} */
|
|
337
|
+
dispose(): void;
|
|
417
338
|
/**
|
|
418
|
-
*
|
|
339
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
340
|
+
*
|
|
341
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
419
342
|
*/
|
|
420
|
-
|
|
421
|
-
/** {@link Disposable.dispose} */
|
|
422
|
-
dispose(): Promise<void>;
|
|
343
|
+
set(mode: NavModeID): void;
|
|
423
344
|
/**
|
|
424
|
-
*
|
|
345
|
+
* Make the camera view fit all the specified meshes.
|
|
425
346
|
*
|
|
426
|
-
* @param
|
|
427
|
-
* @
|
|
347
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
348
|
+
* evaluate {@link Components.meshes}.
|
|
349
|
+
* @param offset the distance to the fit object
|
|
428
350
|
*/
|
|
429
|
-
|
|
351
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
430
352
|
/**
|
|
431
|
-
*
|
|
353
|
+
* Allows or prevents all user input.
|
|
432
354
|
*
|
|
433
|
-
* @param
|
|
434
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
355
|
+
* @param active - whether to enable or disable user inputs.
|
|
435
356
|
*/
|
|
436
|
-
|
|
437
|
-
private
|
|
438
|
-
private
|
|
439
|
-
private
|
|
440
|
-
private
|
|
357
|
+
setUserInput(active: boolean): void;
|
|
358
|
+
private disableUserInput;
|
|
359
|
+
private enableUserInput;
|
|
360
|
+
private newOrthoCamera;
|
|
361
|
+
private setOrthoPerspCameraAspect;
|
|
441
362
|
}
|
|
442
|
-
import
|
|
443
|
-
import {
|
|
363
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
364
|
+
import { Components } from "../Components";
|
|
365
|
+
import { SimpleWorld } from "./src";
|
|
444
366
|
/**
|
|
445
|
-
*
|
|
367
|
+
* A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Worlds). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Worlds).
|
|
446
368
|
*/
|
|
447
|
-
export
|
|
369
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
448
370
|
/**
|
|
449
|
-
*
|
|
371
|
+
* A unique identifier for the component.
|
|
372
|
+
* This UUID is used to register the component within the Components system.
|
|
450
373
|
*/
|
|
451
|
-
|
|
374
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
375
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
376
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
377
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
378
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
379
|
+
/** {@link Disposable.onDisposed} */
|
|
380
|
+
readonly onDisposed: Event<unknown>;
|
|
452
381
|
/**
|
|
453
|
-
*
|
|
382
|
+
* An event that is triggered when a new world is created.
|
|
383
|
+
* The event passes the newly created world as a parameter.
|
|
454
384
|
*/
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
459
|
-
*/
|
|
460
|
-
export declare class MeasurementUtils extends Component {
|
|
385
|
+
readonly onWorldCreated: Event<World>;
|
|
461
386
|
/**
|
|
462
|
-
*
|
|
463
|
-
*
|
|
387
|
+
* An event that is triggered when a world is deleted.
|
|
388
|
+
* The event passes the UUID of the deleted world as a parameter.
|
|
464
389
|
*/
|
|
465
|
-
|
|
390
|
+
readonly onWorldDeleted: Event<string>;
|
|
391
|
+
/**
|
|
392
|
+
* A collection of worlds managed by this component.
|
|
393
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
394
|
+
*/
|
|
395
|
+
list: Map<string, World>;
|
|
466
396
|
/** {@link Component.enabled} */
|
|
467
397
|
enabled: boolean;
|
|
468
398
|
constructor(components: Components);
|
|
469
399
|
/**
|
|
470
|
-
*
|
|
400
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
471
401
|
*
|
|
472
|
-
* @
|
|
473
|
-
* @
|
|
474
|
-
* @
|
|
475
|
-
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
476
|
-
* @returns The distance from the point to the line segment.
|
|
477
|
-
*/
|
|
478
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
479
|
-
/**
|
|
480
|
-
* Method to get the face of a mesh that contains a given triangle index.
|
|
481
|
-
* It also returns the edges of the found face and their indices.
|
|
402
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
403
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
404
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
482
405
|
*
|
|
483
|
-
* @
|
|
484
|
-
* @param triangleIndex - The index of the triangle within the mesh.
|
|
485
|
-
* @param instance - The instance of the mesh (optional).
|
|
486
|
-
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
406
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
487
407
|
*/
|
|
488
|
-
|
|
489
|
-
edges: MeasureEdge[];
|
|
490
|
-
indices: Set<number>;
|
|
491
|
-
} | null;
|
|
408
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
492
409
|
/**
|
|
493
|
-
*
|
|
494
|
-
* It also applies instance transformation if provided.
|
|
410
|
+
* Deletes a world from the list of worlds.
|
|
495
411
|
*
|
|
496
|
-
* @param
|
|
497
|
-
*
|
|
498
|
-
* @
|
|
499
|
-
*
|
|
500
|
-
* @
|
|
412
|
+
* @param {World} world - The world to be deleted.
|
|
413
|
+
*
|
|
414
|
+
* @throws {Error} - Throws an error if the provided world is not found in the list.
|
|
415
|
+
*
|
|
416
|
+
* @returns {void}
|
|
501
417
|
*/
|
|
502
|
-
|
|
503
|
-
p1: THREE.Vector3;
|
|
504
|
-
p2: THREE.Vector3;
|
|
505
|
-
p3: THREE.Vector3;
|
|
506
|
-
faceNormal: THREE.Vector3;
|
|
507
|
-
};
|
|
418
|
+
delete(world: World): void;
|
|
508
419
|
/**
|
|
509
|
-
*
|
|
510
|
-
* This
|
|
420
|
+
* Disposes of the Worlds component and all its managed worlds.
|
|
421
|
+
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
422
|
+
* and triggers the onDisposed event.
|
|
511
423
|
*
|
|
512
|
-
* @
|
|
513
|
-
* @returns The vector with rounded components.
|
|
424
|
+
* @returns {void}
|
|
514
425
|
*/
|
|
515
|
-
|
|
516
|
-
|
|
426
|
+
dispose(): void;
|
|
427
|
+
/** {@link Updateable.update} */
|
|
428
|
+
update(delta?: number): void | Promise<void>;
|
|
517
429
|
}
|
|
518
|
-
import
|
|
430
|
+
import { MiniMap } from "./src";
|
|
431
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
519
432
|
import { Components } from "../Components";
|
|
520
|
-
import { Component } from "../Types";
|
|
521
433
|
/**
|
|
522
|
-
* A
|
|
434
|
+
* A component that manages multiple {@link MiniMap} instances, each associated with a unique world ID. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MiniMap). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MiniMaps).
|
|
523
435
|
*/
|
|
524
|
-
export declare class
|
|
525
|
-
private _disposedComponents;
|
|
526
|
-
/** {@link Component.enabled} */
|
|
527
|
-
enabled: boolean;
|
|
436
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
528
437
|
/**
|
|
529
438
|
* A unique identifier for the component.
|
|
530
439
|
* This UUID is used to register the component within the Components system.
|
|
531
440
|
*/
|
|
532
|
-
static readonly uuid: "
|
|
533
|
-
|
|
441
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
442
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
443
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
444
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
445
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
446
|
+
/** {@link Disposable.onDisposed} */
|
|
447
|
+
readonly onDisposed: Event<unknown>;
|
|
448
|
+
/** {@link Component.enabled} */
|
|
449
|
+
enabled: boolean;
|
|
534
450
|
/**
|
|
535
|
-
*
|
|
451
|
+
* A collection of {@link MiniMap} instances, each associated with a unique world ID.
|
|
536
452
|
*/
|
|
537
|
-
|
|
453
|
+
list: Map<string, MiniMap>;
|
|
454
|
+
constructor(components: Components);
|
|
538
455
|
/**
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
* remove them from the mesh before disposing it.
|
|
542
|
-
*
|
|
543
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
544
|
-
* to remove.
|
|
545
|
-
*
|
|
546
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
456
|
+
* Creates a new {@link MiniMap} instance associated with the given world.
|
|
457
|
+
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
547
458
|
*
|
|
548
|
-
* @param
|
|
459
|
+
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
460
|
+
* @returns The newly created {@link MiniMap} instance.
|
|
461
|
+
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
549
462
|
*/
|
|
550
|
-
|
|
463
|
+
create(world: World): MiniMap;
|
|
551
464
|
/**
|
|
552
|
-
*
|
|
465
|
+
* Deletes a {@link MiniMap} instance associated with the given world ID.
|
|
466
|
+
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
553
467
|
*
|
|
554
|
-
* @param
|
|
555
|
-
*
|
|
556
|
-
* to remove.
|
|
468
|
+
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
469
|
+
* @returns {void}
|
|
557
470
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
471
|
+
delete(id: string): void;
|
|
472
|
+
/** {@link Disposable.dispose} */
|
|
473
|
+
dispose(): void;
|
|
474
|
+
/** {@link Updateable.update} */
|
|
475
|
+
update(): void;
|
|
562
476
|
}
|
|
563
|
-
import
|
|
564
|
-
import {
|
|
477
|
+
import { Components } from "../Components";
|
|
478
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
479
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
565
480
|
/**
|
|
566
|
-
* A component that
|
|
481
|
+
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
567
482
|
*/
|
|
568
|
-
export declare class
|
|
483
|
+
export declare class Cullers extends Component implements Disposable {
|
|
569
484
|
/**
|
|
570
485
|
* A unique identifier for the component.
|
|
571
486
|
* This UUID is used to register the component within the Components system.
|
|
572
487
|
*/
|
|
573
|
-
static readonly uuid: "
|
|
488
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
489
|
+
/**
|
|
490
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
491
|
+
*/
|
|
492
|
+
readonly onDisposed: Event<unknown>;
|
|
493
|
+
private _enabled;
|
|
494
|
+
/**
|
|
495
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
496
|
+
*/
|
|
497
|
+
list: Map<string, MeshCullerRenderer>;
|
|
574
498
|
/** {@link Component.enabled} */
|
|
575
|
-
enabled: boolean;
|
|
499
|
+
get enabled(): boolean;
|
|
500
|
+
/** {@link Component.enabled} */
|
|
501
|
+
set enabled(value: boolean);
|
|
576
502
|
constructor(components: Components);
|
|
577
503
|
/**
|
|
578
|
-
*
|
|
579
|
-
* If
|
|
580
|
-
* If 'items' is provided, only the specified fragments will be affected.
|
|
504
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
505
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
581
506
|
*
|
|
582
|
-
* @param
|
|
583
|
-
* @param
|
|
584
|
-
*
|
|
507
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
508
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
509
|
+
*
|
|
510
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
511
|
+
*/
|
|
512
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
513
|
+
/**
|
|
514
|
+
* Deletes the MeshCullerRenderer associated with the given world.
|
|
515
|
+
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
516
|
+
*
|
|
517
|
+
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
585
518
|
*
|
|
586
519
|
* @returns {void}
|
|
587
520
|
*/
|
|
588
|
-
|
|
521
|
+
delete(world: World): void;
|
|
522
|
+
/** {@link Disposable.dispose} */
|
|
523
|
+
dispose(): void;
|
|
524
|
+
}
|
|
525
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
526
|
+
import { SimpleRaycaster } from "./src";
|
|
527
|
+
import { Components } from "../Components";
|
|
528
|
+
/**
|
|
529
|
+
* A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
|
|
530
|
+
*/
|
|
531
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
589
532
|
/**
|
|
590
|
-
*
|
|
591
|
-
*
|
|
533
|
+
* A unique identifier for the component.
|
|
534
|
+
* This UUID is used to register the component within the Components system.
|
|
535
|
+
*/
|
|
536
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
537
|
+
/** {@link Component.enabled} */
|
|
538
|
+
enabled: boolean;
|
|
539
|
+
/**
|
|
540
|
+
* A Map that stores raycasters for each world.
|
|
541
|
+
* The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
|
|
542
|
+
*/
|
|
543
|
+
list: Map<string, SimpleRaycaster>;
|
|
544
|
+
/** {@link Disposable.onDisposed} */
|
|
545
|
+
onDisposed: Event<unknown>;
|
|
546
|
+
constructor(components: Components);
|
|
547
|
+
/**
|
|
548
|
+
* Retrieves a SimpleRaycaster instance for the given world.
|
|
549
|
+
* If a SimpleRaycaster instance already exists for the world, it will be returned.
|
|
550
|
+
* Otherwise, a new SimpleRaycaster instance will be created and added to the list.
|
|
592
551
|
*
|
|
593
|
-
* @param
|
|
594
|
-
*
|
|
552
|
+
* @param world - The world for which to retrieve or create a SimpleRaycaster instance.
|
|
553
|
+
* @returns The SimpleRaycaster instance for the given world.
|
|
554
|
+
*/
|
|
555
|
+
get(world: World): SimpleRaycaster;
|
|
556
|
+
/**
|
|
557
|
+
* Deletes the SimpleRaycaster instance associated with the given world.
|
|
558
|
+
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
595
559
|
*
|
|
560
|
+
* @param world - The world for which to delete the SimpleRaycaster instance.
|
|
596
561
|
* @returns {void}
|
|
597
562
|
*/
|
|
598
|
-
|
|
599
|
-
|
|
563
|
+
delete(world: World): void;
|
|
564
|
+
/** {@link Disposable.dispose} */
|
|
565
|
+
dispose(): void;
|
|
566
|
+
}
|
|
567
|
+
import * as THREE from "three";
|
|
568
|
+
import { Component, Components } from "../../core";
|
|
569
|
+
/**
|
|
570
|
+
* Represents an edge measurement result.
|
|
571
|
+
*/
|
|
572
|
+
export interface MeasureEdge {
|
|
573
|
+
/**
|
|
574
|
+
* The distance between the two points of the edge.
|
|
575
|
+
*/
|
|
576
|
+
distance: number;
|
|
577
|
+
/**
|
|
578
|
+
* The two points that define the edge.
|
|
579
|
+
*/
|
|
580
|
+
points: THREE.Vector3[];
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/MeasurementUtils). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/MeasurementUtils).
|
|
584
|
+
*/
|
|
585
|
+
export declare class MeasurementUtils extends Component {
|
|
586
|
+
/**
|
|
587
|
+
* A unique identifier for the component.
|
|
588
|
+
* This UUID is used to register the component within the Components system.
|
|
589
|
+
*/
|
|
590
|
+
static uuid: string;
|
|
591
|
+
/** {@link Component.enabled} */
|
|
592
|
+
enabled: boolean;
|
|
593
|
+
constructor(components: Components);
|
|
594
|
+
/**
|
|
595
|
+
* Utility method to calculate the distance from a point to a line segment.
|
|
596
|
+
*
|
|
597
|
+
* @param point - The point from which to calculate the distance.
|
|
598
|
+
* @param lineStart - The start point of the line segment.
|
|
599
|
+
* @param lineEnd - The end point of the line segment.
|
|
600
|
+
* @param clamp - If true, the distance will be clamped to the line segment's length.
|
|
601
|
+
* @returns The distance from the point to the line segment.
|
|
602
|
+
*/
|
|
603
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
604
|
+
/**
|
|
605
|
+
* Method to get the face of a mesh that contains a given triangle index.
|
|
606
|
+
* It also returns the edges of the found face and their indices.
|
|
607
|
+
*
|
|
608
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
609
|
+
* @param triangleIndex - The index of the triangle within the mesh.
|
|
610
|
+
* @param instance - The instance of the mesh (optional).
|
|
611
|
+
* @returns An object containing the edges of the found face and their indices, or null if no face was found.
|
|
612
|
+
*/
|
|
613
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
614
|
+
edges: MeasureEdge[];
|
|
615
|
+
indices: Set<number>;
|
|
616
|
+
} | null;
|
|
617
|
+
/**
|
|
618
|
+
* Method to get the vertices and normal of a mesh face at a given index.
|
|
619
|
+
* It also applies instance transformation if provided.
|
|
620
|
+
*
|
|
621
|
+
* @param mesh - The mesh to get the face from. It must be indexed.
|
|
622
|
+
* @param faceIndex - The index of the face within the mesh.
|
|
623
|
+
* @param instance - The instance of the mesh (optional).
|
|
624
|
+
* @returns An object containing the vertices and normal of the face.
|
|
625
|
+
* @throws Will throw an error if the geometry is not indexed.
|
|
626
|
+
*/
|
|
627
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
628
|
+
p1: THREE.Vector3;
|
|
629
|
+
p2: THREE.Vector3;
|
|
630
|
+
p3: THREE.Vector3;
|
|
631
|
+
faceNormal: THREE.Vector3;
|
|
632
|
+
};
|
|
633
|
+
/**
|
|
634
|
+
* Method to round the vector's components to a specified number of decimal places.
|
|
635
|
+
* This is used to ensure numerical precision in edge detection.
|
|
636
|
+
*
|
|
637
|
+
* @param vector - The vector to round.
|
|
638
|
+
* @returns The vector with rounded components.
|
|
639
|
+
*/
|
|
640
|
+
round(vector: THREE.Vector3): void;
|
|
641
|
+
private getFaceData;
|
|
600
642
|
}
|
|
601
643
|
import * as THREE from "three";
|
|
602
644
|
import * as FRAGS from "@thatopen/fragments";
|
|
@@ -783,14 +825,6 @@ export declare class BoundingBoxer extends Component implements Disposable {
|
|
|
783
825
|
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
784
826
|
private static getFragmentBounds;
|
|
785
827
|
}
|
|
786
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
787
|
-
import * as THREE from "three";
|
|
788
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
789
|
-
center: THREE.Vector3;
|
|
790
|
-
halfSizes: THREE.Vector3;
|
|
791
|
-
rotation: THREE.Matrix3;
|
|
792
|
-
transformation: THREE.Matrix4;
|
|
793
|
-
};
|
|
794
828
|
import * as THREE from "three";
|
|
795
829
|
import * as FRAGS from "@thatopen/fragments";
|
|
796
830
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
@@ -955,605 +989,666 @@ export declare class Classifier extends Component implements Disposable {
|
|
|
955
989
|
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
956
990
|
protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number): void;
|
|
957
991
|
}
|
|
958
|
-
import
|
|
959
|
-
import { Component, Components, Event, World } from "../core";
|
|
960
|
-
export interface VertexPickerConfig {
|
|
961
|
-
showOnlyVertex: boolean;
|
|
962
|
-
snapDistance: number;
|
|
963
|
-
previewElement: HTMLElement;
|
|
964
|
-
}
|
|
965
|
-
export declare class VertexPicker extends Component {
|
|
966
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
967
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
968
|
-
components: Components;
|
|
969
|
-
private _pickedPoint;
|
|
970
|
-
private _config;
|
|
971
|
-
private _enabled;
|
|
972
|
-
private _workingPlane;
|
|
973
|
-
set enabled(value: boolean);
|
|
974
|
-
get enabled(): boolean;
|
|
975
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
976
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
977
|
-
get workingPlane(): THREE.Plane | null;
|
|
978
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
979
|
-
get config(): Partial<VertexPickerConfig>;
|
|
980
|
-
dispose(): void;
|
|
981
|
-
get(world: World): THREE.Vector3 | null;
|
|
982
|
-
private getClosestVertex;
|
|
983
|
-
private getVertices;
|
|
984
|
-
private getVertex;
|
|
985
|
-
}
|
|
986
|
-
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
987
|
-
import { Components } from "../Components";
|
|
988
|
-
import { SimpleWorld } from "./src";
|
|
992
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
989
993
|
/**
|
|
990
|
-
*
|
|
994
|
+
* The Exploder component is responsible for managing the explosion of 3D model fragments (generally by floor). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Exploder). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Exploder).
|
|
991
995
|
*/
|
|
992
|
-
export declare class
|
|
996
|
+
export declare class Exploder extends Component implements Disposable {
|
|
993
997
|
/**
|
|
994
998
|
* A unique identifier for the component.
|
|
995
999
|
* This UUID is used to register the component within the Components system.
|
|
996
1000
|
*/
|
|
997
|
-
static readonly uuid: "
|
|
998
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
999
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1000
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1001
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1001
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
1002
1002
|
/** {@link Disposable.onDisposed} */
|
|
1003
1003
|
readonly onDisposed: Event<unknown>;
|
|
1004
|
+
/** {@link Component.enabled} */
|
|
1005
|
+
enabled: boolean;
|
|
1004
1006
|
/**
|
|
1005
|
-
*
|
|
1006
|
-
*
|
|
1007
|
+
* The height of the explosion animation.
|
|
1008
|
+
* This property determines the vertical distance by which fragments are moved during the explosion.
|
|
1009
|
+
* Default value is 10.
|
|
1007
1010
|
*/
|
|
1008
|
-
|
|
1011
|
+
height: number;
|
|
1009
1012
|
/**
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1013
|
+
* The group name used for the explosion animation.
|
|
1014
|
+
* This property specifies the group of fragments that will be affected by the explosion.
|
|
1015
|
+
* Default value is "storeys".
|
|
1012
1016
|
*/
|
|
1013
|
-
|
|
1017
|
+
groupName: string;
|
|
1014
1018
|
/**
|
|
1015
|
-
* A
|
|
1016
|
-
*
|
|
1019
|
+
* A set of strings representing the exploded items.
|
|
1020
|
+
* This set is used to keep track of which items have been exploded.
|
|
1017
1021
|
*/
|
|
1018
|
-
list:
|
|
1019
|
-
/** {@link Component.enabled} */
|
|
1020
|
-
enabled: boolean;
|
|
1022
|
+
list: Set<string>;
|
|
1021
1023
|
constructor(components: Components);
|
|
1024
|
+
/** {@link Disposable.dispose} */
|
|
1025
|
+
dispose(): void;
|
|
1022
1026
|
/**
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
1025
|
-
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
1026
|
-
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
1027
|
-
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
1028
|
-
*
|
|
1029
|
-
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
1030
|
-
*/
|
|
1031
|
-
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
1032
|
-
/**
|
|
1033
|
-
* Deletes a world from the list of worlds.
|
|
1027
|
+
* Sets the explosion state of the fragments.
|
|
1034
1028
|
*
|
|
1035
|
-
* @param
|
|
1029
|
+
* @param active - A boolean indicating whether to activate or deactivate the explosion.
|
|
1036
1030
|
*
|
|
1037
|
-
* @
|
|
1031
|
+
* @remarks
|
|
1032
|
+
* This method applies a vertical transformation to the fragments based on the 'active' parameter.
|
|
1033
|
+
* If 'active' is true, the fragments are moved upwards by a distance determined by the 'height' property.
|
|
1034
|
+
* If 'active' is false, the fragments are moved back to their original position.
|
|
1038
1035
|
*
|
|
1039
|
-
*
|
|
1040
|
-
*/
|
|
1041
|
-
delete(world: World): void;
|
|
1042
|
-
/**
|
|
1043
|
-
* Disposes of the Worlds component and all its managed worlds.
|
|
1044
|
-
* This method sets the enabled flag to false, disposes of all worlds, clears the list,
|
|
1045
|
-
* and triggers the onDisposed event.
|
|
1036
|
+
* The method also keeps track of the exploded items using the 'list' set.
|
|
1046
1037
|
*
|
|
1047
|
-
* @
|
|
1038
|
+
* @throws Will throw an error if the 'Classifier' or 'FragmentsManager' components are not found in the 'components' system.
|
|
1048
1039
|
*/
|
|
1049
|
-
|
|
1050
|
-
/** {@link Updateable.update} */
|
|
1051
|
-
update(delta?: number): void | Promise<void>;
|
|
1052
|
-
}
|
|
1053
|
-
import * as THREE from "three";
|
|
1054
|
-
export declare class MaterialsUtils {
|
|
1055
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
1040
|
+
set(active: boolean): void;
|
|
1056
1041
|
}
|
|
1057
|
-
import
|
|
1058
|
-
import {
|
|
1059
|
-
import {
|
|
1042
|
+
import * as WEBIFC from "web-ifc";
|
|
1043
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
1044
|
+
import { PropertiesStreamingSettings } from "./src";
|
|
1060
1045
|
/**
|
|
1061
|
-
* A component that
|
|
1046
|
+
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
1062
1047
|
*/
|
|
1063
|
-
export declare class
|
|
1048
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
1064
1049
|
/**
|
|
1065
1050
|
* A unique identifier for the component.
|
|
1066
1051
|
* This UUID is used to register the component within the Components system.
|
|
1067
1052
|
*/
|
|
1068
|
-
static readonly uuid: "
|
|
1069
|
-
/** {@link Component.enabled} */
|
|
1070
|
-
enabled: boolean;
|
|
1053
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1071
1054
|
/**
|
|
1072
|
-
*
|
|
1073
|
-
* The
|
|
1055
|
+
* An event that is triggered when properties are streamed from the IFC file.
|
|
1056
|
+
* The event provides the type of the IFC entity and the corresponding data.
|
|
1074
1057
|
*/
|
|
1075
|
-
|
|
1058
|
+
readonly onPropertiesStreamed: AsyncEvent<{
|
|
1059
|
+
type: number;
|
|
1060
|
+
data: {
|
|
1061
|
+
[id: number]: any;
|
|
1062
|
+
};
|
|
1063
|
+
}>;
|
|
1064
|
+
/**
|
|
1065
|
+
* An event that is triggered to indicate the progress of the streaming process.
|
|
1066
|
+
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
1067
|
+
*/
|
|
1068
|
+
readonly onProgress: AsyncEvent<number>;
|
|
1069
|
+
/**
|
|
1070
|
+
* An event that is triggered when indices are streamed from the IFC file.
|
|
1071
|
+
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
1072
|
+
*/
|
|
1073
|
+
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
1076
1074
|
/** {@link Disposable.onDisposed} */
|
|
1077
|
-
onDisposed: Event<
|
|
1078
|
-
|
|
1075
|
+
readonly onDisposed: Event<string>;
|
|
1076
|
+
/** {@link Component.enabled} */
|
|
1077
|
+
enabled: boolean;
|
|
1079
1078
|
/**
|
|
1080
|
-
*
|
|
1081
|
-
|
|
1082
|
-
|
|
1079
|
+
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
1080
|
+
*/
|
|
1081
|
+
settings: PropertiesStreamingSettings;
|
|
1082
|
+
/**
|
|
1083
|
+
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
1084
|
+
*/
|
|
1085
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1086
|
+
/** {@link Disposable.dispose} */
|
|
1087
|
+
dispose(): Promise<void>;
|
|
1088
|
+
/**
|
|
1089
|
+
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
1083
1090
|
*
|
|
1084
|
-
* @param
|
|
1085
|
-
* @returns
|
|
1091
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1092
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1086
1093
|
*/
|
|
1087
|
-
|
|
1094
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1088
1095
|
/**
|
|
1089
|
-
*
|
|
1090
|
-
* If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
|
|
1096
|
+
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
1091
1097
|
*
|
|
1092
|
-
* @param
|
|
1093
|
-
* @returns
|
|
1098
|
+
* @param loadCallback - A callback function that loads the IFC file data.
|
|
1099
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1094
1100
|
*/
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1101
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1102
|
+
private readIfcFile;
|
|
1103
|
+
private streamIfcFile;
|
|
1104
|
+
private streamAllProperties;
|
|
1105
|
+
private cleanUp;
|
|
1098
1106
|
}
|
|
1107
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
1099
1108
|
import * as THREE from "three";
|
|
1100
|
-
import
|
|
1101
|
-
import {
|
|
1102
|
-
import {
|
|
1109
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1110
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1111
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
1103
1112
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
*
|
|
1106
|
-
* @param components - the instance of {@link Components} used.
|
|
1107
|
-
* E.g. {@link SimplePlane}.
|
|
1113
|
+
* Component to load, delete and manage [fragments](https://github.com/ThatOpen/engine_fragment) efficiently. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/FragmentsManager). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/FragmentsManager).
|
|
1108
1114
|
*/
|
|
1109
|
-
export declare class
|
|
1115
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
1110
1116
|
/**
|
|
1111
1117
|
* A unique identifier for the component.
|
|
1112
1118
|
* This UUID is used to register the component within the Components system.
|
|
1113
1119
|
*/
|
|
1114
|
-
static readonly uuid: "
|
|
1115
|
-
/**
|
|
1116
|
-
readonly
|
|
1117
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1118
|
-
readonly onAfterDrag: Event<void>;
|
|
1120
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
1121
|
+
/** {@link Disposable.onDisposed} */
|
|
1122
|
+
readonly onDisposed: Event<unknown>;
|
|
1119
1123
|
/**
|
|
1120
|
-
* Event
|
|
1124
|
+
* Event triggered when fragments are loaded.
|
|
1121
1125
|
*/
|
|
1122
|
-
readonly
|
|
1126
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
1123
1127
|
/**
|
|
1124
|
-
* Event
|
|
1128
|
+
* Event triggered when fragments are disposed.
|
|
1125
1129
|
*/
|
|
1126
|
-
readonly
|
|
1130
|
+
readonly onFragmentsDisposed: Event<{
|
|
1131
|
+
groupID: string;
|
|
1132
|
+
fragmentIDs: string[];
|
|
1133
|
+
}>;
|
|
1127
1134
|
/**
|
|
1128
|
-
*
|
|
1135
|
+
* Map containing all loaded fragments.
|
|
1136
|
+
* The key is the fragment's unique identifier, and the value is the fragment itself.
|
|
1129
1137
|
*/
|
|
1130
|
-
readonly
|
|
1138
|
+
readonly list: Map<string, Fragment>;
|
|
1131
1139
|
/**
|
|
1132
|
-
*
|
|
1140
|
+
* Map containing all loaded fragment groups.
|
|
1141
|
+
* The key is the group's unique identifier, and the value is the group itself.
|
|
1133
1142
|
*/
|
|
1134
|
-
readonly
|
|
1143
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
1144
|
+
baseCoordinationModel: string;
|
|
1145
|
+
/** {@link Component.enabled} */
|
|
1146
|
+
enabled: boolean;
|
|
1147
|
+
private _loader;
|
|
1135
1148
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1149
|
+
* Getter for the meshes of all fragments in the FragmentsManager.
|
|
1150
|
+
* It iterates over the fragments in the list and pushes their meshes into an array.
|
|
1151
|
+
* @returns {THREE.Mesh[]} An array of THREE.Mesh objects representing the fragments.
|
|
1138
1152
|
*/
|
|
1139
|
-
|
|
1153
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
1154
|
+
constructor(components: Components);
|
|
1155
|
+
/** {@link Disposable.dispose} */
|
|
1156
|
+
dispose(): void;
|
|
1140
1157
|
/**
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1158
|
+
* Dispose of a specific fragment group.
|
|
1159
|
+
* This method removes the group from the groups map, deletes all fragments within the group from the list,
|
|
1160
|
+
* disposes of the group, and triggers the onFragmentsDisposed event.
|
|
1161
|
+
*
|
|
1162
|
+
* @param group - The fragment group to be disposed.
|
|
1143
1163
|
*/
|
|
1144
|
-
|
|
1145
|
-
/** {@link Disposable.onDisposed} */
|
|
1146
|
-
readonly onDisposed: Event<string>;
|
|
1164
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
1147
1165
|
/**
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1166
|
+
* Loads a binary file that contain fragment geometry.
|
|
1167
|
+
* @param data - The binary data to load.
|
|
1168
|
+
* @param config - Optional configuration for loading.
|
|
1169
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
1170
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
1171
|
+
* @returns The loaded FragmentsGroup.
|
|
1152
1172
|
*/
|
|
1153
|
-
|
|
1173
|
+
load(data: Uint8Array, config?: Partial<{
|
|
1174
|
+
coordinate: boolean;
|
|
1175
|
+
name: string;
|
|
1176
|
+
properties: FRAGS.IfcProperties;
|
|
1177
|
+
relationsMap: RelationsMap;
|
|
1178
|
+
}>): FragmentsGroup;
|
|
1154
1179
|
/**
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1180
|
+
* Export the specified fragmentsgroup to binary data.
|
|
1181
|
+
* @param group - the fragments group to be exported.
|
|
1182
|
+
* @returns the exported data as binary buffer.
|
|
1158
1183
|
*/
|
|
1159
|
-
|
|
1184
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
1160
1185
|
/**
|
|
1161
|
-
*
|
|
1162
|
-
*
|
|
1186
|
+
* Gets a map of model IDs to sets of express IDs for the given fragment ID map.
|
|
1187
|
+
* @param fragmentIdMap - A map of fragment IDs to their corresponding express IDs.
|
|
1188
|
+
* @returns A map of model IDs to sets of express IDs.
|
|
1163
1189
|
*/
|
|
1164
|
-
|
|
1190
|
+
getModelIdMap(fragmentIdMap: FRAGS.FragmentIdMap): {
|
|
1191
|
+
[modelID: string]: Set<number>;
|
|
1192
|
+
};
|
|
1165
1193
|
/**
|
|
1166
|
-
*
|
|
1194
|
+
* Converts a map of model IDs to sets of express IDs to a fragment ID map.
|
|
1195
|
+
* @param modelIdMap - A map of model IDs to their corresponding express IDs.
|
|
1196
|
+
* @returns A fragment ID map.
|
|
1197
|
+
* @remarks
|
|
1198
|
+
* This method iterates through the provided model ID map, retrieves the corresponding model from the 'groups' map,
|
|
1199
|
+
* and then calls the 'getFragmentMap' method of the model to obtain a fragment ID map for the given express IDs.
|
|
1200
|
+
* The fragment ID maps are then merged into a single map and returned.
|
|
1201
|
+
* 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.
|
|
1167
1202
|
*/
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
private _size;
|
|
1172
|
-
private _enabled;
|
|
1173
|
-
private _visible;
|
|
1174
|
-
/** {@link Component.enabled} */
|
|
1175
|
-
get enabled(): boolean;
|
|
1176
|
-
/** {@link Component.enabled} */
|
|
1177
|
-
set enabled(state: boolean);
|
|
1178
|
-
/** {@link Hideable.visible } */
|
|
1179
|
-
get visible(): boolean;
|
|
1180
|
-
/** {@link Hideable.visible } */
|
|
1181
|
-
set visible(state: boolean);
|
|
1182
|
-
/** The material of the clipping plane representation. */
|
|
1183
|
-
get material(): THREE.MeshBasicMaterial;
|
|
1184
|
-
/** The material of the clipping plane representation. */
|
|
1185
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
1186
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
1187
|
-
get size(): number;
|
|
1188
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
1189
|
-
set size(size: number);
|
|
1190
|
-
constructor(components: Components);
|
|
1191
|
-
/** {@link Disposable.dispose} */
|
|
1192
|
-
dispose(): void;
|
|
1193
|
-
/** {@link Createable.create} */
|
|
1194
|
-
create(world: World): void;
|
|
1203
|
+
modelIdToFragmentIdMap(modelIdMap: {
|
|
1204
|
+
[modelID: string]: Set<number>;
|
|
1205
|
+
}): FRAGS.FragmentIdMap;
|
|
1195
1206
|
/**
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1207
|
+
* Applies coordinate transformation to the provided models.
|
|
1208
|
+
* If no models are provided, all groups are used.
|
|
1209
|
+
* The first model in the list becomes the base model for coordinate transformation.
|
|
1210
|
+
* All other models are then transformed to match the base model's coordinate system.
|
|
1198
1211
|
*
|
|
1199
|
-
* @param
|
|
1200
|
-
*
|
|
1201
|
-
* @param point - the position of the clipping plane.
|
|
1202
|
-
* navigation.
|
|
1203
|
-
*/
|
|
1204
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
1205
|
-
/**
|
|
1206
|
-
* {@link Createable.delete}
|
|
1212
|
+
* @param models - The models to apply coordinate transformation to.
|
|
1213
|
+
* If not provided, all groups are used.
|
|
1207
1214
|
*
|
|
1208
|
-
* @
|
|
1209
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
1210
|
-
* found under the cursor will be deleted.
|
|
1215
|
+
* @returns {void}
|
|
1211
1216
|
*/
|
|
1212
|
-
|
|
1213
|
-
/** Deletes all the existing clipping planes. */
|
|
1214
|
-
deleteAll(): void;
|
|
1215
|
-
private deletePlane;
|
|
1216
|
-
private pickPlane;
|
|
1217
|
-
private getAllPlaneMeshes;
|
|
1218
|
-
private createPlaneFromIntersection;
|
|
1219
|
-
private getWorldNormal;
|
|
1220
|
-
private normalizePlaneDirectionY;
|
|
1221
|
-
private newPlane;
|
|
1222
|
-
private updateMaterialsAndPlanes;
|
|
1223
|
-
private _onStartDragging;
|
|
1224
|
-
private _onEndDragging;
|
|
1225
|
-
}
|
|
1226
|
-
export declare class UUID {
|
|
1227
|
-
private static _pattern;
|
|
1228
|
-
private static _lut;
|
|
1229
|
-
static create(): string;
|
|
1230
|
-
static validate(uuid: string): void;
|
|
1217
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
1231
1218
|
}
|
|
1232
|
-
import * as
|
|
1233
|
-
import
|
|
1234
|
-
import {
|
|
1235
|
-
import {
|
|
1219
|
+
import * as WEBIFC from "web-ifc";
|
|
1220
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1221
|
+
import { IfcFragmentSettings } from "./src";
|
|
1222
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
1236
1223
|
/**
|
|
1237
|
-
*
|
|
1224
|
+
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
1238
1225
|
*/
|
|
1239
|
-
export declare class
|
|
1226
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
1240
1227
|
/**
|
|
1241
|
-
* A
|
|
1242
|
-
|
|
1243
|
-
|
|
1228
|
+
* A unique identifier for the component.
|
|
1229
|
+
* This UUID is used to register the component within the Components system.
|
|
1230
|
+
*/
|
|
1231
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
1232
|
+
/** {@link Disposable.onDisposed} */
|
|
1233
|
+
readonly onDisposed: Event<string>;
|
|
1244
1234
|
/**
|
|
1245
|
-
*
|
|
1246
|
-
* This camera is used when the projection mode is set to orthographic.
|
|
1235
|
+
* An event triggered when the IFC file starts loading.
|
|
1247
1236
|
*/
|
|
1248
|
-
readonly
|
|
1237
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
1249
1238
|
/**
|
|
1250
|
-
*
|
|
1251
|
-
* This camera is used when the projection mode is set to perspective.
|
|
1239
|
+
* An event triggered when the setup process is completed.
|
|
1252
1240
|
*/
|
|
1253
|
-
readonly
|
|
1254
|
-
protected readonly _userInputButtons: any;
|
|
1255
|
-
protected readonly _frustumSize = 50;
|
|
1256
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
1257
|
-
protected _mode: NavigationMode | null;
|
|
1258
|
-
private previousSize;
|
|
1241
|
+
readonly onSetup: Event<void>;
|
|
1259
1242
|
/**
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1263
|
-
* @returns {NavigationMode} The current navigation mode.
|
|
1264
|
-
*
|
|
1265
|
-
* @throws {Error} Throws an error if the mode is not found or the camera is not initialized.
|
|
1243
|
+
* The settings for the IfcLoader.
|
|
1244
|
+
* It includes options for excluding categories, setting WASM paths, and more.
|
|
1266
1245
|
*/
|
|
1267
|
-
|
|
1246
|
+
settings: IfcFragmentSettings;
|
|
1247
|
+
/**
|
|
1248
|
+
* The instance of the Web-IFC library used for handling IFC data.
|
|
1249
|
+
*/
|
|
1250
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1251
|
+
/** {@link Component.enabled} */
|
|
1252
|
+
enabled: boolean;
|
|
1253
|
+
private _material;
|
|
1254
|
+
private _spatialTree;
|
|
1255
|
+
private _metaData;
|
|
1256
|
+
private _fragmentInstances;
|
|
1257
|
+
private _civil;
|
|
1258
|
+
private _visitedFragments;
|
|
1259
|
+
private _materialT;
|
|
1268
1260
|
constructor(components: Components);
|
|
1269
1261
|
/** {@link Disposable.dispose} */
|
|
1270
1262
|
dispose(): void;
|
|
1271
1263
|
/**
|
|
1272
|
-
* Sets
|
|
1264
|
+
* Sets up the IfcLoader component with the provided configuration.
|
|
1273
1265
|
*
|
|
1274
|
-
* @param
|
|
1266
|
+
* @param config - Optional configuration settings for the IfcLoader.
|
|
1267
|
+
* If not provided, the existing settings will be used.
|
|
1268
|
+
*
|
|
1269
|
+
* @returns A Promise that resolves when the setup process is completed.
|
|
1270
|
+
*
|
|
1271
|
+
* @remarks
|
|
1272
|
+
* If the 'autoSetWasm' option is enabled in the configuration,
|
|
1273
|
+
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
1274
|
+
*
|
|
1275
|
+
* @example
|
|
1276
|
+
* '''typescript
|
|
1277
|
+
* const ifcLoader = new IfcLoader(components);
|
|
1278
|
+
* await ifcLoader.setup({ autoSetWasm: true });
|
|
1279
|
+
* '''
|
|
1275
1280
|
*/
|
|
1276
|
-
|
|
1281
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
1277
1282
|
/**
|
|
1278
|
-
*
|
|
1283
|
+
* Loads an IFC file and processes it for 3D visualization.
|
|
1279
1284
|
*
|
|
1280
|
-
* @param
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1285
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1286
|
+
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
1287
|
+
*
|
|
1288
|
+
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
1289
|
+
*
|
|
1290
|
+
* @example
|
|
1291
|
+
* '''typescript
|
|
1292
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1293
|
+
* const group = await ifcLoader.load(ifcData);
|
|
1294
|
+
* '''
|
|
1283
1295
|
*/
|
|
1284
|
-
|
|
1296
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
1285
1297
|
/**
|
|
1286
|
-
*
|
|
1298
|
+
* Reads an IFC file and initializes the Web-IFC library.
|
|
1287
1299
|
*
|
|
1288
|
-
* @param
|
|
1300
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1301
|
+
*
|
|
1302
|
+
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
1303
|
+
*
|
|
1304
|
+
* @remarks
|
|
1305
|
+
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
1306
|
+
* It also opens the IFC model using the provided data and settings.
|
|
1307
|
+
*
|
|
1308
|
+
* @example
|
|
1309
|
+
* '''typescript
|
|
1310
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1311
|
+
* await ifcLoader.readIfcFile(ifcData);
|
|
1312
|
+
* '''
|
|
1289
1313
|
*/
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1314
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
1317
|
+
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
1318
|
+
*
|
|
1319
|
+
* @remarks
|
|
1320
|
+
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
1321
|
+
*
|
|
1322
|
+
* @example
|
|
1323
|
+
* '''typescript
|
|
1324
|
+
* const ifcLoader = components.get(IfcLoader);
|
|
1325
|
+
* ifcLoader.cleanUp();
|
|
1326
|
+
* '''
|
|
1327
|
+
*/
|
|
1328
|
+
cleanUp(): void;
|
|
1329
|
+
private getAllGeometries;
|
|
1330
|
+
private getMesh;
|
|
1331
|
+
private getGeometry;
|
|
1332
|
+
private autoSetWasm;
|
|
1295
1333
|
}
|
|
1296
|
-
import
|
|
1297
|
-
import {
|
|
1298
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
1334
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1335
|
+
import { Components, Component } from "../../core";
|
|
1299
1336
|
/**
|
|
1300
|
-
* A component that
|
|
1337
|
+
* A component that hides or isolates fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Hider). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Hider).
|
|
1301
1338
|
*/
|
|
1302
|
-
export declare class
|
|
1339
|
+
export declare class Hider extends Component {
|
|
1303
1340
|
/**
|
|
1304
1341
|
* A unique identifier for the component.
|
|
1305
1342
|
* This UUID is used to register the component within the Components system.
|
|
1306
1343
|
*/
|
|
1307
|
-
static readonly uuid: "
|
|
1308
|
-
/**
|
|
1309
|
-
* An event that is triggered when the Cullers component is disposed.
|
|
1310
|
-
*/
|
|
1311
|
-
readonly onDisposed: Event<unknown>;
|
|
1312
|
-
private _enabled;
|
|
1313
|
-
/**
|
|
1314
|
-
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
1315
|
-
*/
|
|
1316
|
-
list: Map<string, MeshCullerRenderer>;
|
|
1317
|
-
/** {@link Component.enabled} */
|
|
1318
|
-
get enabled(): boolean;
|
|
1344
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
1319
1345
|
/** {@link Component.enabled} */
|
|
1320
|
-
|
|
1346
|
+
enabled: boolean;
|
|
1321
1347
|
constructor(components: Components);
|
|
1322
1348
|
/**
|
|
1323
|
-
*
|
|
1324
|
-
* If
|
|
1349
|
+
* Sets the visibility of fragments within the 3D scene.
|
|
1350
|
+
* If no 'items' parameter is provided, all fragments will be set to the specified visibility.
|
|
1351
|
+
* If 'items' is provided, only the specified fragments will be affected.
|
|
1325
1352
|
*
|
|
1326
|
-
* @param
|
|
1327
|
-
* @param
|
|
1353
|
+
* @param visible - The visibility state to set for the fragments.
|
|
1354
|
+
* @param items - An optional map of fragment IDs and their corresponding sub-fragment IDs to be affected.
|
|
1355
|
+
* If not provided, all fragments will be affected.
|
|
1328
1356
|
*
|
|
1329
|
-
* @returns
|
|
1357
|
+
* @returns {void}
|
|
1330
1358
|
*/
|
|
1331
|
-
|
|
1359
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
1332
1360
|
/**
|
|
1333
|
-
*
|
|
1334
|
-
*
|
|
1361
|
+
* Isolates fragments within the 3D scene by hiding all other fragments and showing only the specified ones.
|
|
1362
|
+
* It calls the 'set' method twice: first to hide all fragments, and then to show only the specified ones.
|
|
1335
1363
|
*
|
|
1336
|
-
* @param
|
|
1364
|
+
* @param items - A map of fragment IDs and their corresponding sub-fragment IDs to be isolated.
|
|
1365
|
+
* If not provided, all fragments will be isolated.
|
|
1337
1366
|
*
|
|
1338
1367
|
* @returns {void}
|
|
1339
1368
|
*/
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
dispose(): void;
|
|
1369
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
1370
|
+
private updateCulledVisibility;
|
|
1343
1371
|
}
|
|
1344
|
-
import
|
|
1345
|
-
|
|
1346
|
-
|
|
1372
|
+
import * as THREE from "three";
|
|
1373
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
1374
|
+
center: THREE.Vector3;
|
|
1375
|
+
halfSizes: THREE.Vector3;
|
|
1376
|
+
rotation: THREE.Matrix3;
|
|
1377
|
+
transformation: THREE.Matrix4;
|
|
1378
|
+
};
|
|
1379
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
1380
|
+
import * as WEBIFC from "web-ifc";
|
|
1381
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1382
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
1347
1383
|
/**
|
|
1348
|
-
*
|
|
1384
|
+
* Types for boolean properties in IFC schema.
|
|
1349
1385
|
*/
|
|
1350
|
-
export
|
|
1386
|
+
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1387
|
+
/**
|
|
1388
|
+
* Types for string properties in IFC schema.
|
|
1389
|
+
*/
|
|
1390
|
+
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1391
|
+
/**
|
|
1392
|
+
* Types for numeric properties in IFC schema.
|
|
1393
|
+
*/
|
|
1394
|
+
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1395
|
+
/**
|
|
1396
|
+
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1397
|
+
*/
|
|
1398
|
+
export interface ChangeMap {
|
|
1399
|
+
[modelID: string]: Set<number>;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1403
|
+
*/
|
|
1404
|
+
export interface AttributeListener {
|
|
1405
|
+
[modelID: string]: {
|
|
1406
|
+
[expressID: number]: {
|
|
1407
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1408
|
+
};
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Component to manage and edit properties and Psets in IFC files.
|
|
1413
|
+
*/
|
|
1414
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
1351
1415
|
/**
|
|
1352
1416
|
* A unique identifier for the component.
|
|
1353
1417
|
* This UUID is used to register the component within the Components system.
|
|
1354
1418
|
*/
|
|
1355
|
-
static readonly uuid: "
|
|
1356
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1357
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1358
|
-
/** {@link Updateable.onBeforeUpdate} */
|
|
1359
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
1419
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
1360
1420
|
/** {@link Disposable.onDisposed} */
|
|
1361
|
-
readonly onDisposed: Event<
|
|
1362
|
-
/** {@link Component.enabled} */
|
|
1363
|
-
enabled: boolean;
|
|
1421
|
+
readonly onDisposed: Event<string>;
|
|
1364
1422
|
/**
|
|
1365
|
-
*
|
|
1423
|
+
* Event triggered when a file is requested for export.
|
|
1366
1424
|
*/
|
|
1367
|
-
|
|
1368
|
-
constructor(components: Components);
|
|
1425
|
+
readonly onRequestFile: Event<unknown>;
|
|
1369
1426
|
/**
|
|
1370
|
-
*
|
|
1371
|
-
* If a {@link MiniMap} instance already exists for the given world, an error will be thrown.
|
|
1372
|
-
*
|
|
1373
|
-
* @param world - The {@link World} for which to create a {@link MiniMap} instance.
|
|
1374
|
-
* @returns The newly created {@link MiniMap} instance.
|
|
1375
|
-
* @throws Will throw an error if a {@link MiniMap} instance already exists for the given world.
|
|
1427
|
+
* ArrayBuffer containing the IFC data to be exported.
|
|
1376
1428
|
*/
|
|
1377
|
-
|
|
1429
|
+
ifcToExport: ArrayBuffer | null;
|
|
1378
1430
|
/**
|
|
1379
|
-
*
|
|
1380
|
-
* If a {@link MiniMap} instance does not exist for the given ID, nothing happens.
|
|
1381
|
-
*
|
|
1382
|
-
* @param id - The unique identifier of the world for which to delete the {@link MiniMap} instance.
|
|
1383
|
-
* @returns {void}
|
|
1431
|
+
* Event triggered when an element is added to a Pset.
|
|
1384
1432
|
*/
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
}
|
|
1391
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
1392
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
1393
|
-
import { Components } from "../Components";
|
|
1394
|
-
/**
|
|
1395
|
-
* A component that manages grid instances. Each grid is associated with a unique world. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Grids). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Grids).
|
|
1396
|
-
*/
|
|
1397
|
-
export declare class Grids extends Component implements Disposable {
|
|
1433
|
+
readonly onElementToPset: Event<{
|
|
1434
|
+
model: FragmentsGroup;
|
|
1435
|
+
psetID: number;
|
|
1436
|
+
elementID: number;
|
|
1437
|
+
}>;
|
|
1398
1438
|
/**
|
|
1399
|
-
*
|
|
1400
|
-
* This UUID is used to register the component within the Components system.
|
|
1439
|
+
* Event triggered when a property is added to a Pset.
|
|
1401
1440
|
*/
|
|
1402
|
-
|
|
1441
|
+
readonly onPropToPset: Event<{
|
|
1442
|
+
model: FragmentsGroup;
|
|
1443
|
+
psetID: number;
|
|
1444
|
+
propID: number;
|
|
1445
|
+
}>;
|
|
1403
1446
|
/**
|
|
1404
|
-
*
|
|
1447
|
+
* Event triggered when a Pset is removed.
|
|
1405
1448
|
*/
|
|
1406
|
-
|
|
1449
|
+
readonly onPsetRemoved: Event<{
|
|
1450
|
+
model: FragmentsGroup;
|
|
1451
|
+
psetID: number;
|
|
1452
|
+
}>;
|
|
1407
1453
|
/**
|
|
1408
|
-
*
|
|
1454
|
+
* Event triggered when data in the model changes.
|
|
1409
1455
|
*/
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1456
|
+
readonly onDataChanged: Event<{
|
|
1457
|
+
model: FragmentsGroup;
|
|
1458
|
+
expressID: number;
|
|
1459
|
+
}>;
|
|
1460
|
+
/**
|
|
1461
|
+
* Configuration for the WebAssembly module.
|
|
1462
|
+
*/
|
|
1463
|
+
wasm: {
|
|
1464
|
+
path: string;
|
|
1465
|
+
absolute: boolean;
|
|
1466
|
+
};
|
|
1413
1467
|
/** {@link Component.enabled} */
|
|
1414
1468
|
enabled: boolean;
|
|
1469
|
+
/**
|
|
1470
|
+
* Map of attribute listeners.
|
|
1471
|
+
*/
|
|
1472
|
+
attributeListeners: AttributeListener;
|
|
1473
|
+
/**
|
|
1474
|
+
* The currently selected model.
|
|
1475
|
+
*/
|
|
1476
|
+
selectedModel?: FragmentsGroup;
|
|
1477
|
+
/**
|
|
1478
|
+
* Map of changed entities in the model.
|
|
1479
|
+
*/
|
|
1480
|
+
changeMap: ChangeMap;
|
|
1415
1481
|
constructor(components: Components);
|
|
1482
|
+
/** {@link Disposable.dispose} */
|
|
1483
|
+
dispose(): void;
|
|
1416
1484
|
/**
|
|
1417
|
-
*
|
|
1418
|
-
* Throws an error if a grid already exists for the world.
|
|
1419
|
-
*
|
|
1420
|
-
* @param world - The world to create the grid for.
|
|
1421
|
-
* @returns The newly created grid.
|
|
1485
|
+
* Static method to retrieve the IFC schema from a given model.
|
|
1422
1486
|
*
|
|
1423
|
-
* @
|
|
1487
|
+
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1488
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1489
|
+
* @returns The IFC schema associated with the given model.
|
|
1424
1490
|
*/
|
|
1425
|
-
|
|
1491
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1426
1492
|
/**
|
|
1427
|
-
*
|
|
1428
|
-
* If a grid does not exist for the given world, this method does nothing.
|
|
1493
|
+
* Method to set properties data in the model.
|
|
1429
1494
|
*
|
|
1430
|
-
* @param
|
|
1495
|
+
* @param model - The FragmentsGroup model in which to set the properties.
|
|
1496
|
+
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
1497
|
+
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1498
|
+
* The rest of the properties will be set as the properties of the entity.
|
|
1431
1499
|
*
|
|
1432
|
-
* @
|
|
1433
|
-
*
|
|
1434
|
-
*
|
|
1500
|
+
* @returns {Promise<void>} A promise that resolves when all the properties have been set.
|
|
1501
|
+
*
|
|
1502
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'dataToSave' array.
|
|
1435
1503
|
*/
|
|
1436
|
-
|
|
1437
|
-
/** {@link Disposable.dispose} */
|
|
1438
|
-
dispose(): void;
|
|
1439
|
-
}
|
|
1440
|
-
import { Component, Disposable, Event } from "../Types";
|
|
1441
|
-
/**
|
|
1442
|
-
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
1443
|
-
*/
|
|
1444
|
-
export declare class Components implements Disposable {
|
|
1504
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
1445
1505
|
/**
|
|
1446
|
-
*
|
|
1506
|
+
* Creates a new Property Set (Pset) in the given model.
|
|
1507
|
+
*
|
|
1508
|
+
* @param model - The FragmentsGroup model in which to create the Pset.
|
|
1509
|
+
* @param name - The name of the Pset.
|
|
1510
|
+
* @param description - (Optional) The description of the Pset.
|
|
1511
|
+
*
|
|
1512
|
+
* @returns A promise that resolves with an object containing the newly created Pset and its relation.
|
|
1513
|
+
*
|
|
1514
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1515
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1447
1516
|
*/
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1517
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
1518
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
1519
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
1520
|
+
}>;
|
|
1451
1521
|
/**
|
|
1452
|
-
*
|
|
1453
|
-
*
|
|
1522
|
+
* Removes a Property Set (Pset) from the given model.
|
|
1523
|
+
*
|
|
1524
|
+
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1525
|
+
* @param psetID - The express IDs of the Psets to be removed.
|
|
1526
|
+
*
|
|
1527
|
+
* @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
|
|
1528
|
+
*
|
|
1529
|
+
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1530
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1531
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1454
1532
|
*/
|
|
1455
|
-
|
|
1533
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
1456
1534
|
/**
|
|
1457
|
-
*
|
|
1458
|
-
*
|
|
1535
|
+
* Creates a new single-value property of type string in the given model.
|
|
1536
|
+
*
|
|
1537
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1538
|
+
* @param type - The type of the property value. Must be a string property type.
|
|
1539
|
+
* @param name - The name of the property.
|
|
1540
|
+
* @param value - The value of the property. Must be a string.
|
|
1541
|
+
*
|
|
1542
|
+
* @returns The newly created single-value property.
|
|
1543
|
+
*
|
|
1544
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1545
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1459
1546
|
*/
|
|
1460
|
-
|
|
1461
|
-
private _clock;
|
|
1547
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1462
1548
|
/**
|
|
1463
|
-
*
|
|
1464
|
-
* Throws an error if a component with the same UUID already exists.
|
|
1549
|
+
* Creates a new single-value property of type numeric in the given model.
|
|
1465
1550
|
*
|
|
1466
|
-
* @param
|
|
1467
|
-
* @param
|
|
1551
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1552
|
+
* @param type - The type of the property value. Must be a numeric property type.
|
|
1553
|
+
* @param name - The name of the property.
|
|
1554
|
+
* @param value - The value of the property. Must be a number.
|
|
1468
1555
|
*
|
|
1469
|
-
* @
|
|
1556
|
+
* @returns The newly created single-value property.
|
|
1470
1557
|
*
|
|
1471
|
-
* @
|
|
1558
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1559
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1472
1560
|
*/
|
|
1473
|
-
|
|
1561
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1474
1562
|
/**
|
|
1475
|
-
*
|
|
1476
|
-
* If the component does not exist in the list, it will be created and added.
|
|
1563
|
+
* Creates a new single-value property of type boolean in the given model.
|
|
1477
1564
|
*
|
|
1478
|
-
* @
|
|
1479
|
-
* @param
|
|
1565
|
+
* @param model - The FragmentsGroup model in which to create the property.
|
|
1566
|
+
* @param type - The type of the property value. Must be a boolean property type.
|
|
1567
|
+
* @param name - The name of the property.
|
|
1568
|
+
* @param value - The value of the property. Must be a boolean.
|
|
1480
1569
|
*
|
|
1481
|
-
* @returns The
|
|
1570
|
+
* @returns The newly created single-value property.
|
|
1482
1571
|
*
|
|
1483
|
-
* @throws Will throw an error if
|
|
1572
|
+
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1573
|
+
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1574
|
+
*/
|
|
1575
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
1576
|
+
/**
|
|
1577
|
+
* Removes a property from a Property Set (Pset) in the given model.
|
|
1484
1578
|
*
|
|
1485
|
-
* @
|
|
1579
|
+
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1580
|
+
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1581
|
+
* @param propID - The express ID of the property to be removed.
|
|
1582
|
+
*
|
|
1583
|
+
* @returns {Promise<void>} A promise that resolves when the property has been removed.
|
|
1584
|
+
*
|
|
1585
|
+
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1586
|
+
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1486
1587
|
*/
|
|
1487
|
-
|
|
1488
|
-
|
|
1588
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
1589
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
1489
1590
|
/**
|
|
1490
|
-
*
|
|
1491
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
1492
|
-
* and calls the update method.
|
|
1591
|
+
* Adds elements to a Property Set (Pset) in the given model.
|
|
1493
1592
|
*
|
|
1494
|
-
* @
|
|
1593
|
+
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1594
|
+
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1595
|
+
* @param elementID - The express IDs of the elements to be added.
|
|
1596
|
+
*
|
|
1597
|
+
* @returns {Promise<void>} A promise that resolves when all the elements have been added.
|
|
1598
|
+
*
|
|
1599
|
+
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1600
|
+
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1601
|
+
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1495
1602
|
*/
|
|
1496
|
-
|
|
1603
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
1497
1604
|
/**
|
|
1498
|
-
*
|
|
1499
|
-
* the library. A memory leak will be created if:
|
|
1605
|
+
* Saves the changes made to the model to a new IFC file.
|
|
1500
1606
|
*
|
|
1501
|
-
*
|
|
1502
|
-
*
|
|
1503
|
-
* Angular, Vue, etc).
|
|
1607
|
+
* @param model - The FragmentsGroup model from which to save the changes.
|
|
1608
|
+
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1504
1609
|
*
|
|
1505
|
-
*
|
|
1506
|
-
* referenced by a reference type (object or array).
|
|
1610
|
+
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1507
1611
|
*
|
|
1508
|
-
*
|
|
1509
|
-
|
|
1612
|
+
* @throws Will throw an error if any issues occur during the saving process.
|
|
1613
|
+
*/
|
|
1614
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
1615
|
+
/**
|
|
1616
|
+
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
1617
|
+
* The listener will trigger an event whenever the attribute's value changes.
|
|
1618
|
+
*
|
|
1619
|
+
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1620
|
+
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1621
|
+
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1622
|
+
*
|
|
1623
|
+
* @returns The event that will be triggered when the attribute's value changes.
|
|
1510
1624
|
*
|
|
1625
|
+
* @throws Will throw an error if the entity with the given expressID doesn't exist.
|
|
1626
|
+
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1627
|
+
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1511
1628
|
*/
|
|
1512
|
-
|
|
1513
|
-
private
|
|
1514
|
-
private
|
|
1629
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
1630
|
+
private increaseMaxID;
|
|
1631
|
+
private newGUID;
|
|
1632
|
+
private getOwnerHistory;
|
|
1633
|
+
private registerChange;
|
|
1634
|
+
private newSingleProperty;
|
|
1515
1635
|
}
|
|
1516
1636
|
import * as WEBIFC from "web-ifc";
|
|
1517
|
-
import
|
|
1518
|
-
import { Component, Components } from "../../core";
|
|
1637
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1638
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
1639
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1640
|
+
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1519
1641
|
/**
|
|
1520
|
-
*
|
|
1642
|
+
* Indexer component 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. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
1521
1643
|
*/
|
|
1522
|
-
export declare class
|
|
1644
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1523
1645
|
/**
|
|
1524
1646
|
* A unique identifier for the component.
|
|
1525
1647
|
* This UUID is used to register the component within the Components system.
|
|
1526
1648
|
*/
|
|
1527
|
-
static readonly uuid: "
|
|
1528
|
-
/** {@link
|
|
1529
|
-
|
|
1530
|
-
constructor(components: Components);
|
|
1531
|
-
/**
|
|
1532
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
1533
|
-
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1534
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
1535
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
1536
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1537
|
-
* to make the location data available (e.g. absolute position of building).
|
|
1538
|
-
*/
|
|
1539
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1540
|
-
}
|
|
1541
|
-
import * as WEBIFC from "web-ifc";
|
|
1542
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
1543
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
1544
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1545
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
1546
|
-
/**
|
|
1547
|
-
* Indexer component 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. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
|
|
1548
|
-
*/
|
|
1549
|
-
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
1550
|
-
/**
|
|
1551
|
-
* A unique identifier for the component.
|
|
1552
|
-
* This UUID is used to register the component within the Components system.
|
|
1553
|
-
*/
|
|
1554
|
-
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1555
|
-
/** {@link Disposable.onDisposed} */
|
|
1556
|
-
readonly onDisposed: Event<string>;
|
|
1649
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1650
|
+
/** {@link Disposable.onDisposed} */
|
|
1651
|
+
readonly onDisposed: Event<string>;
|
|
1557
1652
|
/**
|
|
1558
1653
|
* Event triggered when relations for a model have been indexed.
|
|
1559
1654
|
* This event provides the model's UUID and the relations map generated for that model.
|
|
@@ -1679,306 +1774,250 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
1679
1774
|
/** {@link Disposable.dispose} */
|
|
1680
1775
|
dispose(): void;
|
|
1681
1776
|
}
|
|
1682
|
-
/**
|
|
1683
|
-
* A Set of unique numbers representing different types of IFC geometries.
|
|
1684
|
-
*/
|
|
1685
|
-
export declare const GeometryTypes: Set<number>;
|
|
1686
1777
|
import * as WEBIFC from "web-ifc";
|
|
1687
|
-
import
|
|
1688
|
-
import { Component,
|
|
1689
|
-
/**
|
|
1690
|
-
* Types for boolean properties in IFC schema.
|
|
1691
|
-
*/
|
|
1692
|
-
export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
1693
|
-
/**
|
|
1694
|
-
* Types for string properties in IFC schema.
|
|
1695
|
-
*/
|
|
1696
|
-
export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
1697
|
-
/**
|
|
1698
|
-
* Types for numeric properties in IFC schema.
|
|
1699
|
-
*/
|
|
1700
|
-
export type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
1701
|
-
/**
|
|
1702
|
-
* Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
|
|
1703
|
-
*/
|
|
1704
|
-
export interface ChangeMap {
|
|
1705
|
-
[modelID: string]: Set<number>;
|
|
1706
|
-
}
|
|
1707
|
-
/**
|
|
1708
|
-
* Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
|
|
1709
|
-
*/
|
|
1710
|
-
export interface AttributeListener {
|
|
1711
|
-
[modelID: string]: {
|
|
1712
|
-
[expressID: number]: {
|
|
1713
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
1714
|
-
};
|
|
1715
|
-
};
|
|
1716
|
-
}
|
|
1778
|
+
import * as FRAG from "@thatopen/fragments";
|
|
1779
|
+
import { Component, Components } from "../../core";
|
|
1717
1780
|
/**
|
|
1718
|
-
* Component to
|
|
1781
|
+
* Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
|
|
1719
1782
|
*/
|
|
1720
|
-
export declare class
|
|
1783
|
+
export declare class IfcJsonExporter extends Component {
|
|
1721
1784
|
/**
|
|
1722
1785
|
* A unique identifier for the component.
|
|
1723
1786
|
* This UUID is used to register the component within the Components system.
|
|
1724
1787
|
*/
|
|
1725
|
-
static readonly uuid: "
|
|
1726
|
-
/** {@link
|
|
1727
|
-
|
|
1788
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
1789
|
+
/** {@link Component.enabled} */
|
|
1790
|
+
enabled: boolean;
|
|
1791
|
+
constructor(components: Components);
|
|
1728
1792
|
/**
|
|
1729
|
-
*
|
|
1793
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
1794
|
+
* @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
|
|
1795
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
1796
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
1797
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
1798
|
+
* to make the location data available (e.g. absolute position of building).
|
|
1730
1799
|
*/
|
|
1731
|
-
|
|
1800
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1801
|
+
}
|
|
1802
|
+
import * as THREE from "three";
|
|
1803
|
+
export declare class MaterialsUtils {
|
|
1804
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
1805
|
+
}
|
|
1806
|
+
import * as WEBIFC from "web-ifc";
|
|
1807
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
1808
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
1809
|
+
/**
|
|
1810
|
+
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
1811
|
+
*/
|
|
1812
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
1732
1813
|
/**
|
|
1733
|
-
*
|
|
1814
|
+
* A unique identifier for the component.
|
|
1815
|
+
* This UUID is used to register the component within the Components system.
|
|
1734
1816
|
*/
|
|
1735
|
-
|
|
1817
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
1736
1818
|
/**
|
|
1737
|
-
* Event triggered when
|
|
1819
|
+
* Event triggered when geometry is streamed.
|
|
1820
|
+
* Contains the streamed geometry data and its buffer.
|
|
1738
1821
|
*/
|
|
1739
|
-
readonly
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
elementID: number;
|
|
1822
|
+
readonly onGeometryStreamed: Event<{
|
|
1823
|
+
buffer: Uint8Array;
|
|
1824
|
+
data: StreamedGeometries;
|
|
1743
1825
|
}>;
|
|
1744
1826
|
/**
|
|
1745
|
-
* Event triggered when
|
|
1827
|
+
* Event triggered when assets are streamed.
|
|
1828
|
+
* Contains the streamed assets.
|
|
1746
1829
|
*/
|
|
1747
|
-
readonly
|
|
1748
|
-
model: FragmentsGroup;
|
|
1749
|
-
psetID: number;
|
|
1750
|
-
propID: number;
|
|
1751
|
-
}>;
|
|
1830
|
+
readonly onAssetStreamed: Event<StreamedAsset[]>;
|
|
1752
1831
|
/**
|
|
1753
|
-
* Event triggered
|
|
1832
|
+
* Event triggered to indicate the progress of the streaming process.
|
|
1833
|
+
* Contains the progress percentage.
|
|
1754
1834
|
*/
|
|
1755
|
-
readonly
|
|
1756
|
-
model: FragmentsGroup;
|
|
1757
|
-
psetID: number;
|
|
1758
|
-
}>;
|
|
1835
|
+
readonly onProgress: Event<number>;
|
|
1759
1836
|
/**
|
|
1760
|
-
* Event triggered when
|
|
1837
|
+
* Event triggered when the IFC file is loaded.
|
|
1838
|
+
* Contains the loaded IFC file data.
|
|
1761
1839
|
*/
|
|
1762
|
-
readonly
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}>;
|
|
1840
|
+
readonly onIfcLoaded: Event<Uint8Array>;
|
|
1841
|
+
/** {@link Disposable.onDisposed} */
|
|
1842
|
+
readonly onDisposed: Event<unknown>;
|
|
1766
1843
|
/**
|
|
1767
|
-
*
|
|
1844
|
+
* Settings for the IfcGeometryTiler.
|
|
1768
1845
|
*/
|
|
1769
|
-
|
|
1770
|
-
path: string;
|
|
1771
|
-
absolute: boolean;
|
|
1772
|
-
};
|
|
1846
|
+
settings: IfcStreamingSettings;
|
|
1773
1847
|
/** {@link Component.enabled} */
|
|
1774
1848
|
enabled: boolean;
|
|
1775
1849
|
/**
|
|
1776
|
-
*
|
|
1777
|
-
*/
|
|
1778
|
-
attributeListeners: AttributeListener;
|
|
1779
|
-
/**
|
|
1780
|
-
* The currently selected model.
|
|
1781
|
-
*/
|
|
1782
|
-
selectedModel?: FragmentsGroup;
|
|
1783
|
-
/**
|
|
1784
|
-
* Map of changed entities in the model.
|
|
1850
|
+
* The WebIFC API instance used for IFC file processing.
|
|
1785
1851
|
*/
|
|
1786
|
-
|
|
1852
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1853
|
+
private _spatialTree;
|
|
1854
|
+
private _metaData;
|
|
1855
|
+
private _visitedGeometries;
|
|
1856
|
+
private _streamSerializer;
|
|
1857
|
+
private _geometries;
|
|
1858
|
+
private _geometryCount;
|
|
1859
|
+
private _civil;
|
|
1860
|
+
private _groupSerializer;
|
|
1861
|
+
private _assets;
|
|
1862
|
+
private _meshesWithHoles;
|
|
1787
1863
|
constructor(components: Components);
|
|
1788
1864
|
/** {@link Disposable.dispose} */
|
|
1789
1865
|
dispose(): void;
|
|
1790
1866
|
/**
|
|
1791
|
-
*
|
|
1792
|
-
*
|
|
1793
|
-
* @param model - The FragmentsGroup model from which to retrieve the IFC schema.
|
|
1794
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1795
|
-
* @returns The IFC schema associated with the given model.
|
|
1796
|
-
*/
|
|
1797
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
1798
|
-
/**
|
|
1799
|
-
* Method to set properties data in the model.
|
|
1867
|
+
* This method streams the IFC file from a given buffer.
|
|
1800
1868
|
*
|
|
1801
|
-
* @param
|
|
1802
|
-
* @
|
|
1803
|
-
* Each object must have an 'expressID' property, which is the express ID of the entity in the model.
|
|
1804
|
-
* The rest of the properties will be set as the properties of the entity.
|
|
1869
|
+
* @param data - The Uint8Array containing the IFC file data.
|
|
1870
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1805
1871
|
*
|
|
1806
|
-
* @
|
|
1872
|
+
* @remarks
|
|
1873
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1807
1874
|
*
|
|
1808
|
-
* @
|
|
1875
|
+
* @example
|
|
1876
|
+
* '''typescript
|
|
1877
|
+
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
1878
|
+
* const rawBuffer = await response.arrayBuffer();
|
|
1879
|
+
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
1880
|
+
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
1881
|
+
* '''
|
|
1809
1882
|
*/
|
|
1810
|
-
|
|
1883
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1811
1884
|
/**
|
|
1812
|
-
*
|
|
1885
|
+
* This method streams the IFC file from a given callback.
|
|
1813
1886
|
*
|
|
1814
|
-
* @param
|
|
1815
|
-
* @
|
|
1816
|
-
* @param description - (Optional) The description of the Pset.
|
|
1887
|
+
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
1888
|
+
* @returns A Promise that resolves when the streaming process is complete.
|
|
1817
1889
|
*
|
|
1818
|
-
* @
|
|
1890
|
+
* @remarks
|
|
1891
|
+
* This method cleans up any resources after the streaming process is complete.
|
|
1819
1892
|
*
|
|
1820
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1821
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1822
1893
|
*/
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1894
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1895
|
+
private readIfcFile;
|
|
1896
|
+
private streamIfcFile;
|
|
1897
|
+
private streamAllGeometries;
|
|
1898
|
+
private cleanUp;
|
|
1899
|
+
private getMesh;
|
|
1900
|
+
private getGeometry;
|
|
1901
|
+
private streamAssets;
|
|
1902
|
+
private streamGeometries;
|
|
1903
|
+
}
|
|
1904
|
+
export declare class UUID {
|
|
1905
|
+
private static _pattern;
|
|
1906
|
+
private static _lut;
|
|
1907
|
+
static create(): string;
|
|
1908
|
+
static validate(uuid: string): void;
|
|
1909
|
+
}
|
|
1910
|
+
import * as THREE from "three";
|
|
1911
|
+
import { Component, Components, Disposable, Event, World } from "../core";
|
|
1912
|
+
/**
|
|
1913
|
+
* Configuration interface for the VertexPicker component.
|
|
1914
|
+
*/
|
|
1915
|
+
export interface VertexPickerConfig {
|
|
1827
1916
|
/**
|
|
1828
|
-
*
|
|
1829
|
-
*
|
|
1830
|
-
* @param model - The FragmentsGroup model from which to remove the Pset.
|
|
1831
|
-
* @param psetID - The express IDs of the Psets to be removed.
|
|
1832
|
-
*
|
|
1833
|
-
* @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
|
|
1834
|
-
*
|
|
1835
|
-
* @throws Will throw an error if any of the 'expressID' properties are missing in the 'psetID' array.
|
|
1836
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1837
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1917
|
+
* If true, only vertices will be picked, not the closest point on the face.
|
|
1838
1918
|
*/
|
|
1839
|
-
|
|
1919
|
+
showOnlyVertex: boolean;
|
|
1840
1920
|
/**
|
|
1841
|
-
*
|
|
1842
|
-
*
|
|
1843
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1844
|
-
* @param type - The type of the property value. Must be a string property type.
|
|
1845
|
-
* @param name - The name of the property.
|
|
1846
|
-
* @param value - The value of the property. Must be a string.
|
|
1847
|
-
*
|
|
1848
|
-
* @returns The newly created single-value property.
|
|
1849
|
-
*
|
|
1850
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1851
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1921
|
+
* The maximum distance for snapping to a vertex.
|
|
1852
1922
|
*/
|
|
1853
|
-
|
|
1923
|
+
snapDistance: number;
|
|
1854
1924
|
/**
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
1857
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1858
|
-
* @param type - The type of the property value. Must be a numeric property type.
|
|
1859
|
-
* @param name - The name of the property.
|
|
1860
|
-
* @param value - The value of the property. Must be a number.
|
|
1861
|
-
*
|
|
1862
|
-
* @returns The newly created single-value property.
|
|
1863
|
-
*
|
|
1864
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1865
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1925
|
+
* The HTML element to use for previewing the picked vertex.
|
|
1866
1926
|
*/
|
|
1867
|
-
|
|
1927
|
+
previewElement: HTMLElement;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* A class that provides functionality for picking vertices in a 3D scene.
|
|
1931
|
+
*/
|
|
1932
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
1933
|
+
/** {@link Disposable.onDisposed} */
|
|
1934
|
+
readonly onDisposed: Event<unknown>;
|
|
1868
1935
|
/**
|
|
1869
|
-
*
|
|
1870
|
-
*
|
|
1871
|
-
* @param model - The FragmentsGroup model in which to create the property.
|
|
1872
|
-
* @param type - The type of the property value. Must be a boolean property type.
|
|
1873
|
-
* @param name - The name of the property.
|
|
1874
|
-
* @param value - The value of the property. Must be a boolean.
|
|
1875
|
-
*
|
|
1876
|
-
* @returns The newly created single-value property.
|
|
1877
|
-
*
|
|
1878
|
-
* @throws Will throw an error if the IFC schema is not found in the model.
|
|
1879
|
-
* @throws Will throw an error if no OwnerHistory is found in the model.
|
|
1936
|
+
* An event that is triggered when a vertex is found.
|
|
1937
|
+
* The event passes a THREE.Vector3 representing the position of the found vertex.
|
|
1880
1938
|
*/
|
|
1881
|
-
|
|
1939
|
+
readonly onVertexFound: Event<THREE.Vector3>;
|
|
1882
1940
|
/**
|
|
1883
|
-
*
|
|
1884
|
-
*
|
|
1885
|
-
* @param model - The FragmentsGroup model from which to remove the property.
|
|
1886
|
-
* @param psetID - The express ID of the Pset from which to remove the property.
|
|
1887
|
-
* @param propID - The express ID of the property to be removed.
|
|
1888
|
-
*
|
|
1889
|
-
* @returns {Promise<void>} A promise that resolves when the property has been removed.
|
|
1890
|
-
*
|
|
1891
|
-
* @throws Will throw an error if the Pset or the property to be removed are not found in the model.
|
|
1892
|
-
* @throws Will throw an error if the Pset to be removed is not of type 'IFCPROPERTYSET'.
|
|
1941
|
+
* An event that is triggered when a vertex is lost.
|
|
1942
|
+
* The event passes a THREE.Vector3 representing the position of the lost vertex.
|
|
1893
1943
|
*/
|
|
1894
|
-
|
|
1895
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
1944
|
+
readonly onVertexLost: Event<THREE.Vector3>;
|
|
1896
1945
|
/**
|
|
1897
|
-
*
|
|
1898
|
-
*
|
|
1899
|
-
* @param model - The FragmentsGroup model in which to add the elements.
|
|
1900
|
-
* @param psetID - The express ID of the Pset to which to add the elements.
|
|
1901
|
-
* @param elementID - The express IDs of the elements to be added.
|
|
1902
|
-
*
|
|
1903
|
-
* @returns {Promise<void>} A promise that resolves when all the elements have been added.
|
|
1904
|
-
*
|
|
1905
|
-
* @throws Will throw an error if the Pset or the elements to be added are not found in the model.
|
|
1906
|
-
* @throws Will throw an error if the Pset to be added to is not of type 'IFCPROPERTYSET'.
|
|
1907
|
-
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
1946
|
+
* A reference to the Components instance associated with this VertexPicker.
|
|
1908
1947
|
*/
|
|
1909
|
-
|
|
1948
|
+
components: Components;
|
|
1910
1949
|
/**
|
|
1911
|
-
*
|
|
1912
|
-
*
|
|
1913
|
-
*
|
|
1914
|
-
* @param ifcToSaveOn - The Uint8Array representing the original IFC file.
|
|
1915
|
-
*
|
|
1916
|
-
* @returns A promise that resolves with the modified IFC data as a Uint8Array.
|
|
1917
|
-
*
|
|
1918
|
-
* @throws Will throw an error if any issues occur during the saving process.
|
|
1950
|
+
* A reference to the working plane used for vertex picking.
|
|
1951
|
+
* This plane is used to determine which vertices are considered valid for picking.
|
|
1952
|
+
* If this value is null, all vertices are considered valid.
|
|
1919
1953
|
*/
|
|
1920
|
-
|
|
1954
|
+
workingPlane: THREE.Plane | null;
|
|
1955
|
+
private _pickedPoint;
|
|
1956
|
+
private _config;
|
|
1957
|
+
private _enabled;
|
|
1921
1958
|
/**
|
|
1922
|
-
* Sets
|
|
1923
|
-
*
|
|
1924
|
-
*
|
|
1925
|
-
* @param model - The FragmentsGroup model in which to set the attribute listener.
|
|
1926
|
-
* @param expressID - The express ID of the entity for which to set the listener.
|
|
1927
|
-
* @param attributeName - The name of the attribute for which to set the listener.
|
|
1959
|
+
* Sets the enabled state of the VertexPicker.
|
|
1960
|
+
* When enabled, the VertexPicker will actively search for vertices in the 3D scene.
|
|
1961
|
+
* When disabled, the VertexPicker will stop searching for vertices and reset the picked point.
|
|
1928
1962
|
*
|
|
1929
|
-
* @
|
|
1963
|
+
* @param value - The new enabled state.
|
|
1964
|
+
*/
|
|
1965
|
+
set enabled(value: boolean);
|
|
1966
|
+
/**
|
|
1967
|
+
* Gets the current enabled state of the VertexPicker.
|
|
1930
1968
|
*
|
|
1931
|
-
* @
|
|
1932
|
-
* @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
|
|
1933
|
-
* @throws Will throw an error if the attribute has a badly defined handle.
|
|
1969
|
+
* @returns The current enabled state.
|
|
1934
1970
|
*/
|
|
1935
|
-
|
|
1936
|
-
private increaseMaxID;
|
|
1937
|
-
private newGUID;
|
|
1938
|
-
private getOwnerHistory;
|
|
1939
|
-
private registerChange;
|
|
1940
|
-
private newSingleProperty;
|
|
1941
|
-
}
|
|
1942
|
-
import * as WEBIFC from "web-ifc";
|
|
1943
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
1944
|
-
export declare class IfcFragmentSettings {
|
|
1945
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
1946
|
-
includeProperties: boolean;
|
|
1971
|
+
get enabled(): boolean;
|
|
1947
1972
|
/**
|
|
1948
|
-
*
|
|
1949
|
-
*
|
|
1973
|
+
* Sets the configuration for the VertexPicker component.
|
|
1974
|
+
*
|
|
1975
|
+
* @param value - A Partial object containing the configuration properties to update.
|
|
1976
|
+
* The properties not provided in the value object will retain their current values.
|
|
1977
|
+
*
|
|
1978
|
+
* @example
|
|
1979
|
+
* '''typescript
|
|
1980
|
+
* vertexPicker.config = {
|
|
1981
|
+
* snapDistance: 0.5,
|
|
1982
|
+
* showOnlyVertex: true,
|
|
1983
|
+
* };
|
|
1984
|
+
* '''
|
|
1950
1985
|
*/
|
|
1951
|
-
|
|
1952
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
1953
|
-
coordinate: boolean;
|
|
1954
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1955
|
-
wasm: {
|
|
1956
|
-
path: string;
|
|
1957
|
-
absolute: boolean;
|
|
1958
|
-
logLevel?: WEBIFC.LogLevel;
|
|
1959
|
-
};
|
|
1960
|
-
/** List of categories that won't be converted to fragments. */
|
|
1961
|
-
excludedCategories: Set<number>;
|
|
1962
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
1963
|
-
saveLocations: boolean;
|
|
1964
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1965
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1986
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
1966
1987
|
/**
|
|
1967
|
-
*
|
|
1968
|
-
*
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1988
|
+
* Gets the current configuration for the VertexPicker component.
|
|
1989
|
+
*
|
|
1990
|
+
* @returns A copy of the current VertexPickerConfig object.
|
|
1991
|
+
*
|
|
1992
|
+
* @example
|
|
1993
|
+
* '''typescript
|
|
1994
|
+
* const currentConfig = vertexPicker.config;
|
|
1995
|
+
* console.log(currentConfig.snapDistance); // Output: 0.25
|
|
1996
|
+
* '''
|
|
1971
1997
|
*/
|
|
1972
|
-
|
|
1998
|
+
get config(): Partial<VertexPickerConfig>;
|
|
1999
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
2000
|
+
/** {@link Disposable.dispose} */
|
|
2001
|
+
dispose(): void;
|
|
1973
2002
|
/**
|
|
1974
|
-
*
|
|
1975
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
1976
|
-
* If set to null, the default file location handler will be used.
|
|
2003
|
+
* Performs the vertex picking operation based on the current state of the VertexPicker.
|
|
1977
2004
|
*
|
|
1978
|
-
* @param
|
|
1979
|
-
*
|
|
2005
|
+
* @param world - The World instance to use for raycasting.
|
|
2006
|
+
*
|
|
2007
|
+
* @returns The current picked point, or null if no point is picked.
|
|
2008
|
+
*
|
|
2009
|
+
* @remarks
|
|
2010
|
+
* This method checks if the VertexPicker is enabled. If not, it returns the current picked point.
|
|
2011
|
+
* If enabled, it performs raycasting to find the closest intersecting object.
|
|
2012
|
+
* It then determines the closest vertex or point on the face, based on the configuration settings.
|
|
2013
|
+
* If the picked point is on the working plane (if defined), it triggers the 'onVertexFound' event and updates the 'pickedPoint'.
|
|
2014
|
+
* If the picked point is not on the working plane, it resets the 'pickedPoint'.
|
|
2015
|
+
* If no intersecting object is found, it triggers the 'onVertexLost' event and resets the 'pickedPoint'.
|
|
1980
2016
|
*/
|
|
1981
|
-
|
|
2017
|
+
get(world: World): THREE.Vector3 | null;
|
|
2018
|
+
private getClosestVertex;
|
|
2019
|
+
private getVertices;
|
|
2020
|
+
private getVertex;
|
|
1982
2021
|
}
|
|
1983
2022
|
import * as WEBIFC from "web-ifc";
|
|
1984
2023
|
import { IfcItemsCategories } from "../../../ifc";
|
|
@@ -2077,6 +2116,69 @@ export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
|
2077
2116
|
resize(size?: THREE.Vector2): void;
|
|
2078
2117
|
private updatePlanes;
|
|
2079
2118
|
}
|
|
2119
|
+
/**
|
|
2120
|
+
* A Set of unique numbers representing different types of IFC geometries.
|
|
2121
|
+
*/
|
|
2122
|
+
export declare const GeometryTypes: Set<number>;
|
|
2123
|
+
import * as WEBIFC from "web-ifc";
|
|
2124
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
2125
|
+
export declare class IfcFragmentSettings {
|
|
2126
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
2127
|
+
includeProperties: boolean;
|
|
2128
|
+
/**
|
|
2129
|
+
* Generate the geometry for categories that are not included by default,
|
|
2130
|
+
* like IFCSPACE.
|
|
2131
|
+
*/
|
|
2132
|
+
optionalCategories: number[];
|
|
2133
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
2134
|
+
coordinate: boolean;
|
|
2135
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2136
|
+
wasm: {
|
|
2137
|
+
path: string;
|
|
2138
|
+
absolute: boolean;
|
|
2139
|
+
logLevel?: WEBIFC.LogLevel;
|
|
2140
|
+
};
|
|
2141
|
+
/** List of categories that won't be converted to fragments. */
|
|
2142
|
+
excludedCategories: Set<number>;
|
|
2143
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
2144
|
+
saveLocations: boolean;
|
|
2145
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
2146
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
2147
|
+
/**
|
|
2148
|
+
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2149
|
+
* If set to true, the path will be set to the default path of the WASM file.
|
|
2150
|
+
* If set to false, the path must be provided manually in the 'wasm.path' property.
|
|
2151
|
+
* Default value is true.
|
|
2152
|
+
*/
|
|
2153
|
+
autoSetWasm: boolean;
|
|
2154
|
+
/**
|
|
2155
|
+
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
2156
|
+
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
2157
|
+
* If set to null, the default file location handler will be used.
|
|
2158
|
+
*
|
|
2159
|
+
* @param url - The URL of the file to locate.
|
|
2160
|
+
* @returns The absolute path of the file.
|
|
2161
|
+
*/
|
|
2162
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
2163
|
+
}
|
|
2164
|
+
import * as WEBIFC from "web-ifc";
|
|
2165
|
+
export interface IfcItemsCategories {
|
|
2166
|
+
[itemID: number]: number;
|
|
2167
|
+
}
|
|
2168
|
+
export declare class IfcCategories {
|
|
2169
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* A map of IFC element types to their corresponding names. The keys are the IFC entity type numbers, and the values are the names of the IFC entities.
|
|
2173
|
+
*
|
|
2174
|
+
* @remarks
|
|
2175
|
+
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2176
|
+
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2177
|
+
*
|
|
2178
|
+
*/
|
|
2179
|
+
export declare const IfcElements: {
|
|
2180
|
+
[key: number]: string;
|
|
2181
|
+
};
|
|
2080
2182
|
import * as FRAGS from "@thatopen/fragments";
|
|
2081
2183
|
export declare class IfcPropertiesUtils {
|
|
2082
2184
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -2109,187 +2211,113 @@ export declare const IfcCategoryMap: {
|
|
|
2109
2211
|
[key: number]: string;
|
|
2110
2212
|
};
|
|
2111
2213
|
import * as THREE from "three";
|
|
2112
|
-
import
|
|
2113
|
-
import {
|
|
2214
|
+
import CameraControls from "camera-controls";
|
|
2215
|
+
import { Event } from "./event";
|
|
2114
2216
|
/**
|
|
2115
|
-
*
|
|
2217
|
+
* 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.
|
|
2116
2218
|
*/
|
|
2117
|
-
export interface
|
|
2118
|
-
/**
|
|
2119
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
2120
|
-
* Default value is 1000.
|
|
2121
|
-
*/
|
|
2122
|
-
updateInterval?: number;
|
|
2123
|
-
/**
|
|
2124
|
-
* Width of the render target used for visibility checks.
|
|
2125
|
-
* Default value is 512.
|
|
2126
|
-
*/
|
|
2127
|
-
width?: number;
|
|
2219
|
+
export interface Disposable {
|
|
2128
2220
|
/**
|
|
2129
|
-
*
|
|
2130
|
-
*
|
|
2221
|
+
* Destroys the object from memory to prevent a
|
|
2222
|
+
* [memory leak](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
2131
2223
|
*/
|
|
2132
|
-
|
|
2224
|
+
dispose: () => void | Promise<void>;
|
|
2225
|
+
/** Fired after the tool has been disposed. */
|
|
2226
|
+
readonly onDisposed: Event<any>;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* 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).
|
|
2230
|
+
*/
|
|
2231
|
+
export interface Hideable {
|
|
2133
2232
|
/**
|
|
2134
|
-
* Whether the
|
|
2135
|
-
*
|
|
2233
|
+
* Whether the geometric representation of this component is
|
|
2234
|
+
* currently visible or not in the
|
|
2235
|
+
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2136
2236
|
*/
|
|
2137
|
-
|
|
2237
|
+
visible: boolean;
|
|
2138
2238
|
}
|
|
2139
2239
|
/**
|
|
2140
|
-
*
|
|
2240
|
+
* 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.
|
|
2141
2241
|
*/
|
|
2142
|
-
export
|
|
2143
|
-
/** {@link Disposable.onDisposed} */
|
|
2144
|
-
readonly onDisposed: Event<string>;
|
|
2242
|
+
export interface Resizeable {
|
|
2145
2243
|
/**
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2244
|
+
* Sets size of this component (e.g. the resolution of a
|
|
2245
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2246
|
+
* component.
|
|
2149
2247
|
*/
|
|
2150
|
-
|
|
2248
|
+
resize: (size?: THREE.Vector2) => void;
|
|
2249
|
+
/** Event that fires when the component has been resized. */
|
|
2250
|
+
onResize: Event<THREE.Vector2>;
|
|
2151
2251
|
/**
|
|
2152
|
-
*
|
|
2252
|
+
* Gets the current size of this component (e.g. the resolution of a
|
|
2253
|
+
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2254
|
+
* component.
|
|
2153
2255
|
*/
|
|
2154
|
-
|
|
2256
|
+
getSize: () => THREE.Vector2;
|
|
2257
|
+
}
|
|
2258
|
+
/** Whether this component should be updated each frame. */
|
|
2259
|
+
export interface Updateable {
|
|
2260
|
+
/** Actions that should be executed after updating the component. */
|
|
2261
|
+
onAfterUpdate: Event<any>;
|
|
2262
|
+
/** Actions that should be executed before updating the component. */
|
|
2263
|
+
onBeforeUpdate: Event<any>;
|
|
2155
2264
|
/**
|
|
2156
|
-
*
|
|
2157
|
-
*
|
|
2265
|
+
* Function used to update the state of this component each frame. For
|
|
2266
|
+
* instance, a renderer component will make a render each frame.
|
|
2158
2267
|
*/
|
|
2159
|
-
|
|
2268
|
+
update(delta?: number): void;
|
|
2269
|
+
}
|
|
2270
|
+
/** Basic type to describe the progress of any kind of process. */
|
|
2271
|
+
export interface Progress {
|
|
2272
|
+
/** The amount of things that have been done already. */
|
|
2273
|
+
current: number;
|
|
2274
|
+
/** The total amount of things to be done by the process. */
|
|
2275
|
+
total: number;
|
|
2276
|
+
}
|
|
2277
|
+
/**
|
|
2278
|
+
* Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
|
|
2279
|
+
*/
|
|
2280
|
+
export interface Createable {
|
|
2281
|
+
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
2282
|
+
create: (data: any) => void;
|
|
2160
2283
|
/**
|
|
2161
|
-
*
|
|
2162
|
-
*
|
|
2284
|
+
* Finish the creation process of the component, successfully creating an
|
|
2285
|
+
* instance of whatever the component creates.
|
|
2163
2286
|
*/
|
|
2164
|
-
|
|
2165
|
-
/** The components instance to which this renderer belongs. */
|
|
2166
|
-
components: Components;
|
|
2167
|
-
/** The world instance to which this renderer belongs. */
|
|
2168
|
-
readonly world: World;
|
|
2169
|
-
/** The THREE.js renderer used to make the visibility test. */
|
|
2170
|
-
readonly renderer: THREE.WebGLRenderer;
|
|
2171
|
-
protected autoUpdate: boolean;
|
|
2172
|
-
protected updateInterval: number;
|
|
2173
|
-
protected readonly worker: Worker;
|
|
2174
|
-
protected readonly scene: THREE.Scene;
|
|
2175
|
-
private _width;
|
|
2176
|
-
private _height;
|
|
2177
|
-
private _availableColor;
|
|
2178
|
-
private readonly renderTarget;
|
|
2179
|
-
private readonly bufferSize;
|
|
2180
|
-
private readonly _buffer;
|
|
2181
|
-
protected _isWorkerBusy: boolean;
|
|
2182
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2183
|
-
/** {@link Disposable.dispose} */
|
|
2184
|
-
dispose(): void;
|
|
2287
|
+
endCreation?: (data: any) => void;
|
|
2185
2288
|
/**
|
|
2186
|
-
*
|
|
2187
|
-
*
|
|
2188
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2189
|
-
* not true.
|
|
2289
|
+
* Cancels the creation process of the component, going back to the state
|
|
2290
|
+
* before starting to create.
|
|
2190
2291
|
*/
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
g: number;
|
|
2195
|
-
b: number;
|
|
2196
|
-
code: string;
|
|
2197
|
-
};
|
|
2198
|
-
protected increaseColor(): void;
|
|
2199
|
-
protected decreaseColor(): void;
|
|
2200
|
-
private applySettings;
|
|
2292
|
+
cancelCreation?: (data: any) => void;
|
|
2293
|
+
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
2294
|
+
delete: (data: any) => void;
|
|
2201
2295
|
}
|
|
2202
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2203
2296
|
/**
|
|
2204
|
-
*
|
|
2297
|
+
* Whether this component supports to be configured.
|
|
2205
2298
|
*/
|
|
2206
|
-
export
|
|
2207
|
-
/**
|
|
2208
|
-
|
|
2209
|
-
|
|
2299
|
+
export interface Configurable<T extends Record<string, any>> {
|
|
2300
|
+
/** Wether this components has been already configured. */
|
|
2301
|
+
isSetup: boolean;
|
|
2302
|
+
/** Use the provided configuration to setup the tool. */
|
|
2303
|
+
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
2304
|
+
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
2305
|
+
readonly onSetup: Event<any>;
|
|
2306
|
+
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
2307
|
+
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
2210
2308
|
*/
|
|
2211
|
-
|
|
2309
|
+
config: Required<T>;
|
|
2212
2310
|
}
|
|
2213
2311
|
/**
|
|
2214
|
-
*
|
|
2215
|
-
*
|
|
2216
|
-
* @remarks
|
|
2217
|
-
* This map is used to provide a mapping between IFC entity type numbers and their names.
|
|
2218
|
-
* It is useful for identifying and processing different types of IFC elements in a project.
|
|
2219
|
-
*
|
|
2220
|
-
*/
|
|
2221
|
-
export declare const IfcElements: {
|
|
2222
|
-
[key: number]: string;
|
|
2223
|
-
};
|
|
2224
|
-
import * as THREE from "three";
|
|
2225
|
-
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2226
|
-
import { Components } from "../../Components";
|
|
2227
|
-
import { Event, World, Disposable } from "../../Types";
|
|
2228
|
-
/**
|
|
2229
|
-
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2312
|
+
* Whether a camera uses the Camera Controls library.
|
|
2230
2313
|
*/
|
|
2231
|
-
export
|
|
2232
|
-
/**
|
|
2233
|
-
* Event triggered when the visibility of meshes is updated.
|
|
2234
|
-
* Contains two sets: seen and unseen.
|
|
2235
|
-
*/
|
|
2236
|
-
readonly onViewUpdated: Event<{
|
|
2237
|
-
seen: Set<THREE.Mesh>;
|
|
2238
|
-
unseen: Set<THREE.Mesh>;
|
|
2239
|
-
}>;
|
|
2240
|
-
/**
|
|
2241
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2242
|
-
* Default value is 100.
|
|
2243
|
-
*/
|
|
2244
|
-
threshold: number;
|
|
2245
|
-
/**
|
|
2246
|
-
* Map of color code to THREE.InstancedMesh.
|
|
2247
|
-
* Used to keep track of color-coded meshes.
|
|
2248
|
-
*/
|
|
2249
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2250
|
-
/**
|
|
2251
|
-
* Flag to indicate if the renderer is currently processing.
|
|
2252
|
-
* Used to prevent concurrent processing.
|
|
2253
|
-
*/
|
|
2254
|
-
isProcessing: boolean;
|
|
2255
|
-
private _colorCodeMeshMap;
|
|
2256
|
-
private _meshIDColorCodeMap;
|
|
2257
|
-
private _currentVisibleMeshes;
|
|
2258
|
-
private _recentlyHiddenMeshes;
|
|
2259
|
-
private _intervalID;
|
|
2260
|
-
private readonly _transparentMat;
|
|
2261
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2262
|
-
/** {@link Disposable.dispose} */
|
|
2263
|
-
dispose(): void;
|
|
2264
|
-
/**
|
|
2265
|
-
* 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.
|
|
2266
|
-
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2267
|
-
* @returns {void}
|
|
2268
|
-
*/
|
|
2269
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2314
|
+
export interface CameraControllable {
|
|
2270
2315
|
/**
|
|
2271
|
-
*
|
|
2272
|
-
*
|
|
2273
|
-
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2274
|
-
* @returns {void}
|
|
2316
|
+
* An instance of CameraControls that provides camera control functionalities.
|
|
2317
|
+
* This instance is used to manipulate the camera.
|
|
2275
2318
|
*/
|
|
2276
|
-
|
|
2277
|
-
private handleWorkerMessage;
|
|
2278
|
-
private getAvailableMaterial;
|
|
2279
|
-
}
|
|
2280
|
-
import * as WEBIFC from "web-ifc";
|
|
2281
|
-
export interface IfcItemsCategories {
|
|
2282
|
-
[itemID: number]: number;
|
|
2283
|
-
}
|
|
2284
|
-
export declare class IfcCategories {
|
|
2285
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
2319
|
+
controls: CameraControls;
|
|
2286
2320
|
}
|
|
2287
|
-
import { InverseAttribute } from "./types";
|
|
2288
|
-
export declare const relToAttributesMap: Map<number, {
|
|
2289
|
-
forRelating: InverseAttribute;
|
|
2290
|
-
forRelated: InverseAttribute;
|
|
2291
|
-
}>;
|
|
2292
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2293
2321
|
/**
|
|
2294
2322
|
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2295
2323
|
*/
|
|
@@ -2318,33 +2346,18 @@ export declare class Event<T> {
|
|
|
2318
2346
|
reset(): void;
|
|
2319
2347
|
private handlers;
|
|
2320
2348
|
}
|
|
2349
|
+
import { Base } from "./base";
|
|
2321
2350
|
/**
|
|
2322
|
-
*
|
|
2351
|
+
* Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
|
|
2323
2352
|
*/
|
|
2324
|
-
export declare class
|
|
2325
|
-
/**
|
|
2326
|
-
* Add a callback to this event instance.
|
|
2327
|
-
* @param handler - the callback to be added to this event.
|
|
2328
|
-
*/
|
|
2329
|
-
add(handler: T extends void ? {
|
|
2330
|
-
(): Promise<void>;
|
|
2331
|
-
} : {
|
|
2332
|
-
(data: T): Promise<void>;
|
|
2333
|
-
}): void;
|
|
2353
|
+
export declare abstract class Component extends Base {
|
|
2334
2354
|
/**
|
|
2335
|
-
*
|
|
2336
|
-
*
|
|
2355
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
2356
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
2357
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2358
|
+
* will not be updated automatically each frame.
|
|
2337
2359
|
*/
|
|
2338
|
-
|
|
2339
|
-
(): Promise<void>;
|
|
2340
|
-
} : {
|
|
2341
|
-
(data: T): Promise<void>;
|
|
2342
|
-
}): void;
|
|
2343
|
-
/** Triggers all the callbacks assigned to this event. */
|
|
2344
|
-
trigger: (data?: T) => Promise<void>;
|
|
2345
|
-
/** Gets rid of all the suscribed events. */
|
|
2346
|
-
reset(): void;
|
|
2347
|
-
private handlers;
|
|
2360
|
+
abstract enabled: boolean;
|
|
2348
2361
|
}
|
|
2349
2362
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
2350
2363
|
import { Components } from "../../Components";
|
|
@@ -2366,103 +2379,88 @@ export declare abstract class Base {
|
|
|
2366
2379
|
isConfigurable: () => this is Configurable<any>;
|
|
2367
2380
|
}
|
|
2368
2381
|
import { Base } from "./base";
|
|
2382
|
+
import { World } from "./world";
|
|
2383
|
+
import { Event } from "./event";
|
|
2384
|
+
import { Components } from "../../Components";
|
|
2369
2385
|
/**
|
|
2370
|
-
*
|
|
2386
|
+
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2371
2387
|
*/
|
|
2372
|
-
export declare abstract class
|
|
2388
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
2389
|
+
readonly worlds: Map<string, World>;
|
|
2373
2390
|
/**
|
|
2374
|
-
*
|
|
2375
|
-
*
|
|
2376
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
2377
|
-
* will not be updated automatically each frame.
|
|
2391
|
+
* Event that is triggered when a world is added or removed from the 'worlds' map.
|
|
2392
|
+
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2378
2393
|
*/
|
|
2379
|
-
|
|
2394
|
+
readonly onWorldChanged: Event<{
|
|
2395
|
+
world: World;
|
|
2396
|
+
action: "added" | "removed";
|
|
2397
|
+
}>;
|
|
2398
|
+
/**
|
|
2399
|
+
* The current world this item is associated with. It can be null if no world is currently active.
|
|
2400
|
+
*/
|
|
2401
|
+
currentWorld: World | null;
|
|
2402
|
+
protected constructor(components: Components);
|
|
2380
2403
|
}
|
|
2381
|
-
import * as THREE from "three";
|
|
2382
|
-
import CameraControls from "camera-controls";
|
|
2383
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
2384
|
-
import { CameraControllable } from "./interfaces";
|
|
2385
2404
|
/**
|
|
2386
|
-
*
|
|
2405
|
+
* Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to 'this', you will need to declare the callback as an arrow function.
|
|
2387
2406
|
*/
|
|
2388
|
-
export declare
|
|
2407
|
+
export declare class AsyncEvent<T> {
|
|
2389
2408
|
/**
|
|
2390
|
-
*
|
|
2409
|
+
* Add a callback to this event instance.
|
|
2410
|
+
* @param handler - the callback to be added to this event.
|
|
2391
2411
|
*/
|
|
2392
|
-
|
|
2412
|
+
add(handler: T extends void ? {
|
|
2413
|
+
(): Promise<void>;
|
|
2414
|
+
} : {
|
|
2415
|
+
(data: T): Promise<void>;
|
|
2416
|
+
}): void;
|
|
2393
2417
|
/**
|
|
2394
|
-
*
|
|
2418
|
+
* Removes a callback from this event instance.
|
|
2419
|
+
* @param handler - the callback to be removed from this event.
|
|
2395
2420
|
*/
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
*/
|
|
2407
|
-
hasCameraControls: () => this is CameraControllable;
|
|
2421
|
+
remove(handler: T extends void ? {
|
|
2422
|
+
(): Promise<void>;
|
|
2423
|
+
} : {
|
|
2424
|
+
(data: T): Promise<void>;
|
|
2425
|
+
}): void;
|
|
2426
|
+
/** Triggers all the callbacks assigned to this event. */
|
|
2427
|
+
trigger: (data?: T) => Promise<void>;
|
|
2428
|
+
/** Gets rid of all the suscribed events. */
|
|
2429
|
+
reset(): void;
|
|
2430
|
+
private handlers;
|
|
2408
2431
|
}
|
|
2432
|
+
import { InverseAttribute } from "./types";
|
|
2433
|
+
export declare const relToAttributesMap: Map<number, {
|
|
2434
|
+
forRelating: InverseAttribute;
|
|
2435
|
+
forRelated: InverseAttribute;
|
|
2436
|
+
}>;
|
|
2409
2437
|
import * as THREE from "three";
|
|
2410
|
-
import
|
|
2411
|
-
import { Event } from "./event";
|
|
2412
|
-
import { Components } from "../../Components";
|
|
2438
|
+
import CameraControls from "camera-controls";
|
|
2413
2439
|
import { BaseWorldItem } from "./base-world-item";
|
|
2440
|
+
import { CameraControllable } from "./interfaces";
|
|
2414
2441
|
/**
|
|
2415
|
-
* Abstract class representing a
|
|
2442
|
+
* Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
|
|
2416
2443
|
*/
|
|
2417
|
-
export declare abstract class
|
|
2418
|
-
/** {@link Disposable.onDisposed} */
|
|
2419
|
-
readonly onDisposed: Event<unknown>;
|
|
2444
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
2420
2445
|
/**
|
|
2421
|
-
*
|
|
2422
|
-
* It should be implemented by subclasses.
|
|
2446
|
+
* Whether the camera is enabled or not.
|
|
2423
2447
|
*/
|
|
2424
|
-
abstract
|
|
2425
|
-
protected constructor(components: Components);
|
|
2426
|
-
/** {@link Disposable.dispose} */
|
|
2427
|
-
dispose(): void;
|
|
2428
|
-
}
|
|
2429
|
-
import { Base } from "./base";
|
|
2430
|
-
import { World } from "./world";
|
|
2431
|
-
import { Event } from "./event";
|
|
2432
|
-
import { Components } from "../../Components";
|
|
2433
|
-
/**
|
|
2434
|
-
* One of the elements that make a world. It can be either a scene, a camera or a renderer.
|
|
2435
|
-
*/
|
|
2436
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
2437
|
-
readonly worlds: Map<string, World>;
|
|
2448
|
+
abstract enabled: boolean;
|
|
2438
2449
|
/**
|
|
2439
|
-
*
|
|
2440
|
-
* The event payload contains the world instance and the action ("added" or "removed").
|
|
2450
|
+
* The Three.js camera instance.
|
|
2441
2451
|
*/
|
|
2442
|
-
|
|
2443
|
-
world: World;
|
|
2444
|
-
action: "added" | "removed";
|
|
2445
|
-
}>;
|
|
2452
|
+
abstract three: THREE.Camera;
|
|
2446
2453
|
/**
|
|
2447
|
-
*
|
|
2454
|
+
* Optional CameraControls instance for controlling the camera.
|
|
2455
|
+
* This property is only available if the camera is controllable.
|
|
2448
2456
|
*/
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
2457
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
2458
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2459
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2460
|
-
} | undefined;
|
|
2461
|
-
get(civilItems: any): {
|
|
2462
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
2463
|
-
coordinationMatrix: THREE.Matrix4;
|
|
2464
|
-
} | undefined;
|
|
2465
|
-
private getCurves;
|
|
2457
|
+
abstract controls?: CameraControls;
|
|
2458
|
+
/**
|
|
2459
|
+
* Checks whether the instance is {@link CameraControllable}.
|
|
2460
|
+
*
|
|
2461
|
+
* @returns True if the instance is controllable, false otherwise.
|
|
2462
|
+
*/
|
|
2463
|
+
hasCameraControls: () => this is CameraControllable;
|
|
2466
2464
|
}
|
|
2467
2465
|
import * as THREE from "three";
|
|
2468
2466
|
import { Vector2 } from "three";
|
|
@@ -2530,303 +2528,249 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
2530
2528
|
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
2531
2529
|
}
|
|
2532
2530
|
import * as THREE from "three";
|
|
2533
|
-
import
|
|
2531
|
+
import { Disposable } from "./interfaces";
|
|
2534
2532
|
import { Event } from "./event";
|
|
2533
|
+
import { Components } from "../../Components";
|
|
2534
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
2535
2535
|
/**
|
|
2536
|
-
*
|
|
2536
|
+
* Abstract class representing a base scene in the application. All scenes should use this class as a base.
|
|
2537
2537
|
*/
|
|
2538
|
-
export
|
|
2538
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
2539
|
+
/** {@link Disposable.onDisposed} */
|
|
2540
|
+
readonly onDisposed: Event<unknown>;
|
|
2539
2541
|
/**
|
|
2540
|
-
*
|
|
2541
|
-
*
|
|
2542
|
+
* Abstract property representing the three.js object associated with this scene.
|
|
2543
|
+
* It should be implemented by subclasses.
|
|
2542
2544
|
*/
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2545
|
+
abstract three: THREE.Object3D;
|
|
2546
|
+
protected constructor(components: Components);
|
|
2547
|
+
/** {@link Disposable.dispose} */
|
|
2548
|
+
dispose(): void;
|
|
2546
2549
|
}
|
|
2550
|
+
import * as THREE from "three";
|
|
2551
|
+
import { BaseScene } from "./base-scene";
|
|
2552
|
+
import { BaseCamera } from "./base-camera";
|
|
2553
|
+
import { BaseRenderer } from "./base-renderer";
|
|
2554
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
2547
2555
|
/**
|
|
2548
|
-
*
|
|
2556
|
+
* Represents a 3D world with meshes, scene, camera, renderer, and other properties.
|
|
2549
2557
|
*/
|
|
2550
|
-
export interface
|
|
2558
|
+
export interface World extends Disposable, Updateable {
|
|
2551
2559
|
/**
|
|
2552
|
-
*
|
|
2553
|
-
* currently visible or not in the
|
|
2554
|
-
* [Three.js scene](https://threejs.org/docs/#api/en/scenes/Scene).
|
|
2560
|
+
* A set of meshes present in the world. This is taken into account for operations like raycasting.
|
|
2555
2561
|
*/
|
|
2556
|
-
|
|
2557
|
-
}
|
|
2558
|
-
/**
|
|
2559
|
-
* 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.
|
|
2560
|
-
*/
|
|
2561
|
-
export interface Resizeable {
|
|
2562
|
+
meshes: Set<THREE.Mesh>;
|
|
2562
2563
|
/**
|
|
2563
|
-
*
|
|
2564
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2565
|
-
* component.
|
|
2564
|
+
* The base scene of the world.
|
|
2566
2565
|
*/
|
|
2567
|
-
|
|
2568
|
-
/** Event that fires when the component has been resized. */
|
|
2569
|
-
onResize: Event<THREE.Vector2>;
|
|
2566
|
+
scene: BaseScene;
|
|
2570
2567
|
/**
|
|
2571
|
-
*
|
|
2572
|
-
* [Renderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
|
|
2573
|
-
* component.
|
|
2568
|
+
* The base camera of the world.
|
|
2574
2569
|
*/
|
|
2575
|
-
|
|
2576
|
-
}
|
|
2577
|
-
/** Whether this component should be updated each frame. */
|
|
2578
|
-
export interface Updateable {
|
|
2579
|
-
/** Actions that should be executed after updating the component. */
|
|
2580
|
-
onAfterUpdate: Event<any>;
|
|
2581
|
-
/** Actions that should be executed before updating the component. */
|
|
2582
|
-
onBeforeUpdate: Event<any>;
|
|
2570
|
+
camera: BaseCamera;
|
|
2583
2571
|
/**
|
|
2584
|
-
*
|
|
2585
|
-
* instance, a renderer component will make a render each frame.
|
|
2572
|
+
* The base renderer of the world. Can be null if this world doesn't use a renderer (e.g. in a backend environment).
|
|
2586
2573
|
*/
|
|
2587
|
-
|
|
2588
|
-
}
|
|
2589
|
-
/** Basic type to describe the progress of any kind of process. */
|
|
2590
|
-
export interface Progress {
|
|
2591
|
-
/** The amount of things that have been done already. */
|
|
2592
|
-
current: number;
|
|
2593
|
-
/** The total amount of things to be done by the process. */
|
|
2594
|
-
total: number;
|
|
2595
|
-
}
|
|
2596
|
-
/**
|
|
2597
|
-
* Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions.
|
|
2598
|
-
*/
|
|
2599
|
-
export interface Createable {
|
|
2600
|
-
/** Creates a new instance of an element (e.g. a new Dimension). */
|
|
2601
|
-
create: (data: any) => void;
|
|
2574
|
+
renderer: BaseRenderer | null;
|
|
2602
2575
|
/**
|
|
2603
|
-
*
|
|
2604
|
-
* instance of whatever the component creates.
|
|
2576
|
+
* A unique identifier for the world.
|
|
2605
2577
|
*/
|
|
2606
|
-
|
|
2578
|
+
uuid: string;
|
|
2607
2579
|
/**
|
|
2608
|
-
*
|
|
2609
|
-
* before starting to create.
|
|
2610
|
-
*/
|
|
2611
|
-
cancelCreation?: (data: any) => void;
|
|
2612
|
-
/** Deletes an existing instance of an element (e.g. a Dimension). */
|
|
2613
|
-
delete: (data: any) => void;
|
|
2614
|
-
}
|
|
2615
|
-
/**
|
|
2616
|
-
* Whether this component supports to be configured.
|
|
2617
|
-
*/
|
|
2618
|
-
export interface Configurable<T extends Record<string, any>> {
|
|
2619
|
-
/** Wether this components has been already configured. */
|
|
2620
|
-
isSetup: boolean;
|
|
2621
|
-
/** Use the provided configuration to setup the tool. */
|
|
2622
|
-
setup: (config?: Partial<T>) => void | Promise<void>;
|
|
2623
|
-
/** Fired after successfully calling {@link Configurable.setup()} */
|
|
2624
|
-
readonly onSetup: Event<any>;
|
|
2625
|
-
/** Object holding the tool configuration. Is not meant to be edited directly, if you need
|
|
2626
|
-
* to make changes to this object, use {@link Configurable.setup()} just after the tool is instantiated.
|
|
2580
|
+
* Indicates whether the world is currently disposing. This is useful for cancelling logic that access the elements of a world (which are also disposed).
|
|
2627
2581
|
*/
|
|
2628
|
-
|
|
2582
|
+
isDisposing: boolean;
|
|
2629
2583
|
}
|
|
2584
|
+
import * as THREE from "three";
|
|
2585
|
+
import { Disposable, Event } from "../../Types";
|
|
2630
2586
|
/**
|
|
2631
|
-
*
|
|
2587
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
|
|
2632
2588
|
*/
|
|
2633
|
-
export
|
|
2589
|
+
export declare class Mouse implements Disposable {
|
|
2590
|
+
dom: HTMLCanvasElement;
|
|
2591
|
+
private _event?;
|
|
2592
|
+
private _position;
|
|
2593
|
+
/** {@link Disposable.onDisposed} */
|
|
2594
|
+
readonly onDisposed: Event<unknown>;
|
|
2595
|
+
constructor(dom: HTMLCanvasElement);
|
|
2634
2596
|
/**
|
|
2635
|
-
*
|
|
2636
|
-
* This instance is used to manipulate the camera.
|
|
2597
|
+
* The real position of the mouse of the Three.js canvas.
|
|
2637
2598
|
*/
|
|
2638
|
-
|
|
2599
|
+
get position(): THREE.Vector2;
|
|
2600
|
+
/** {@link Disposable.dispose} */
|
|
2601
|
+
dispose(): void;
|
|
2602
|
+
private getPositionY;
|
|
2603
|
+
private getPositionX;
|
|
2604
|
+
private updateMouseInfo;
|
|
2605
|
+
private setupEvents;
|
|
2639
2606
|
}
|
|
2640
|
-
import
|
|
2607
|
+
import * as THREE from "three";
|
|
2608
|
+
import { Components } from "../../Components";
|
|
2609
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2610
|
+
import { Mouse } from "./mouse";
|
|
2641
2611
|
/**
|
|
2642
|
-
*
|
|
2612
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
2643
2613
|
*/
|
|
2644
|
-
export declare class
|
|
2614
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
2615
|
+
/** {@link Component.enabled} */
|
|
2616
|
+
enabled: boolean;
|
|
2617
|
+
/** The components instance to which this Raycaster belongs. */
|
|
2618
|
+
components: Components;
|
|
2619
|
+
/** {@link Disposable.onDisposed} */
|
|
2620
|
+
readonly onDisposed: Event<unknown>;
|
|
2621
|
+
/** The position of the mouse in the screen. */
|
|
2622
|
+
readonly mouse: Mouse;
|
|
2645
2623
|
/**
|
|
2646
|
-
*
|
|
2647
|
-
*
|
|
2624
|
+
* A reference to the Three.js Raycaster instance.
|
|
2625
|
+
* This is used for raycasting operations.
|
|
2648
2626
|
*/
|
|
2649
|
-
|
|
2627
|
+
readonly three: THREE.Raycaster;
|
|
2650
2628
|
/**
|
|
2651
|
-
*
|
|
2652
|
-
*
|
|
2629
|
+
* A reference to the world instance to which this Raycaster belongs.
|
|
2630
|
+
* This is used to access the camera and meshes.
|
|
2653
2631
|
*/
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
/** An array of geometries associated with the asset. */
|
|
2681
|
-
geometries: {
|
|
2682
|
-
/** The unique identifier of the geometry. */
|
|
2683
|
-
geometryID: number;
|
|
2684
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
2685
|
-
transformation: number[];
|
|
2686
|
-
/** The color of the geometry as a number array. */
|
|
2687
|
-
color: number[];
|
|
2688
|
-
}[];
|
|
2689
|
-
}
|
|
2690
|
-
import * as WEBIFC from "web-ifc";
|
|
2691
|
-
import * as THREE from "three";
|
|
2692
|
-
export declare class Units {
|
|
2693
|
-
factor: number;
|
|
2694
|
-
complement: number;
|
|
2695
|
-
apply(matrix: THREE.Matrix4): void;
|
|
2696
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
2697
|
-
private getLengthUnits;
|
|
2698
|
-
private getScaleMatrix;
|
|
2632
|
+
world: World;
|
|
2633
|
+
constructor(components: Components, world: World);
|
|
2634
|
+
/** {@link Disposable.dispose} */
|
|
2635
|
+
dispose(): void;
|
|
2636
|
+
/**
|
|
2637
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
2638
|
+
* the first item found. This also takes into account the clipping planes
|
|
2639
|
+
* used by the renderer.
|
|
2640
|
+
*
|
|
2641
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
2642
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
2643
|
+
* {@link Components.meshes}.
|
|
2644
|
+
*/
|
|
2645
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
2646
|
+
/**
|
|
2647
|
+
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
2648
|
+
* This method also takes into account the clipping planes used by the renderer.
|
|
2649
|
+
*
|
|
2650
|
+
* @param origin - The origin of the ray.
|
|
2651
|
+
* @param direction - The direction of the ray.
|
|
2652
|
+
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
2653
|
+
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2654
|
+
*/
|
|
2655
|
+
castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
|
|
2656
|
+
private intersect;
|
|
2657
|
+
private filterClippingPlanes;
|
|
2699
2658
|
}
|
|
2700
2659
|
import * as THREE from "three";
|
|
2701
|
-
import { Hideable,
|
|
2660
|
+
import { Hideable, Event, World, Disposable } from "../../Types";
|
|
2702
2661
|
import { Components } from "../../Components";
|
|
2703
2662
|
/**
|
|
2704
|
-
*
|
|
2663
|
+
* Configuration interface for the {@link SimpleGrid} class.
|
|
2705
2664
|
*/
|
|
2706
|
-
export
|
|
2707
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
2708
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
2709
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
2710
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
2711
|
-
/** {@link Disposable.onDisposed} */
|
|
2712
|
-
readonly onDisposed: Event<unknown>;
|
|
2713
|
-
/**
|
|
2714
|
-
* The normal vector of the clipping plane.
|
|
2715
|
-
*/
|
|
2716
|
-
readonly normal: THREE.Vector3;
|
|
2665
|
+
export interface GridConfig {
|
|
2717
2666
|
/**
|
|
2718
|
-
* The
|
|
2667
|
+
* The color of the grid lines.
|
|
2719
2668
|
*/
|
|
2720
|
-
|
|
2669
|
+
color: THREE.Color;
|
|
2721
2670
|
/**
|
|
2722
|
-
* The
|
|
2671
|
+
* The size of the primary grid lines.
|
|
2723
2672
|
*/
|
|
2724
|
-
|
|
2725
|
-
/** The components instance to which this plane belongs. */
|
|
2726
|
-
components: Components;
|
|
2727
|
-
/** The world instance to which this plane belongs. */
|
|
2728
|
-
world: World;
|
|
2729
|
-
protected readonly _helper: THREE.Object3D;
|
|
2730
|
-
protected _visible: boolean;
|
|
2731
|
-
protected _enabled: boolean;
|
|
2732
|
-
private _controlsActive;
|
|
2733
|
-
private readonly _arrowBoundBox;
|
|
2734
|
-
private readonly _planeMesh;
|
|
2735
|
-
private readonly _controls;
|
|
2736
|
-
private readonly _hiddenMaterial;
|
|
2673
|
+
size1: number;
|
|
2737
2674
|
/**
|
|
2738
|
-
*
|
|
2739
|
-
* @returns {boolean} The current enabled state.
|
|
2675
|
+
* The size of the secondary grid lines.
|
|
2740
2676
|
*/
|
|
2741
|
-
|
|
2677
|
+
size2: number;
|
|
2742
2678
|
/**
|
|
2743
|
-
*
|
|
2744
|
-
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
2745
|
-
* @param {boolean} state - The new enabled state.
|
|
2679
|
+
* The distance at which the grid lines start to fade away.
|
|
2746
2680
|
*/
|
|
2747
|
-
|
|
2748
|
-
|
|
2681
|
+
distance: number;
|
|
2682
|
+
}
|
|
2683
|
+
/**
|
|
2684
|
+
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
2685
|
+
*/
|
|
2686
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
2687
|
+
/** {@link Disposable.onDisposed} */
|
|
2688
|
+
readonly onDisposed: Event<unknown>;
|
|
2689
|
+
/** The world instance to which this Raycaster belongs. */
|
|
2690
|
+
world: World;
|
|
2691
|
+
/** The components instance to which this grid belongs. */
|
|
2692
|
+
components: Components;
|
|
2693
|
+
/** {@link Hideable.visible} */
|
|
2749
2694
|
get visible(): boolean;
|
|
2750
|
-
/** {@link Hideable.visible
|
|
2751
|
-
set visible(
|
|
2752
|
-
/** The
|
|
2753
|
-
get
|
|
2754
|
-
/** The material of the clipping plane representation. */
|
|
2755
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
2756
|
-
/** The material of the clipping plane representation. */
|
|
2757
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
2758
|
-
/** The size of the clipping plane representation. */
|
|
2759
|
-
get size(): number;
|
|
2760
|
-
/** Sets the size of the clipping plane representation. */
|
|
2761
|
-
set size(size: number);
|
|
2695
|
+
/** {@link Hideable.visible} */
|
|
2696
|
+
set visible(visible: boolean);
|
|
2697
|
+
/** The material of the grid. */
|
|
2698
|
+
get material(): THREE.ShaderMaterial;
|
|
2762
2699
|
/**
|
|
2763
|
-
*
|
|
2764
|
-
*
|
|
2765
|
-
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
2766
|
-
*
|
|
2767
|
-
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
2700
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2701
|
+
* perspective cameras and false for orthographic cameras.
|
|
2768
2702
|
*/
|
|
2769
|
-
get
|
|
2770
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
2703
|
+
get fade(): boolean;
|
|
2771
2704
|
/**
|
|
2772
|
-
*
|
|
2773
|
-
*
|
|
2774
|
-
* and positions the helper object accordingly.
|
|
2775
|
-
*
|
|
2776
|
-
* @param normal - The new normal vector for the clipping plane.
|
|
2777
|
-
* @param point - The new origin point for the clipping plane.
|
|
2778
|
-
*
|
|
2779
|
-
* @returns {void}
|
|
2705
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
2706
|
+
* perspective cameras and false for orthographic cameras.
|
|
2780
2707
|
*/
|
|
2781
|
-
|
|
2782
|
-
/**
|
|
2783
|
-
|
|
2708
|
+
set fade(active: boolean);
|
|
2709
|
+
/** The Three.js mesh that contains the infinite grid. */
|
|
2710
|
+
readonly three: THREE.Mesh;
|
|
2711
|
+
private _fade;
|
|
2712
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
2784
2713
|
/** {@link Disposable.dispose} */
|
|
2785
2714
|
dispose(): void;
|
|
2786
|
-
private
|
|
2787
|
-
|
|
2788
|
-
private newTransformControls;
|
|
2789
|
-
private initializeControls;
|
|
2790
|
-
private createArrowBoundingBox;
|
|
2791
|
-
private changeDrag;
|
|
2792
|
-
private notifyDraggingChanged;
|
|
2793
|
-
private preventCameraMovement;
|
|
2794
|
-
private newHelper;
|
|
2795
|
-
private static newPlaneMesh;
|
|
2715
|
+
private setupEvents;
|
|
2716
|
+
private updateZoom;
|
|
2796
2717
|
}
|
|
2718
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
2797
2719
|
import * as THREE from "three";
|
|
2798
|
-
import {
|
|
2799
|
-
import {
|
|
2800
|
-
import {
|
|
2801
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
2720
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
2721
|
+
import { Components } from "../../Components";
|
|
2722
|
+
import { Event, World, Disposable } from "../../Types";
|
|
2802
2723
|
/**
|
|
2803
|
-
*
|
|
2724
|
+
* A renderer to hide/show meshes depending on their visibility from the user's point of view.
|
|
2804
2725
|
*/
|
|
2805
|
-
export
|
|
2726
|
+
export declare class MeshCullerRenderer extends CullerRenderer implements Disposable {
|
|
2806
2727
|
/**
|
|
2807
|
-
*
|
|
2728
|
+
* Event triggered when the visibility of meshes is updated.
|
|
2729
|
+
* Contains two sets: seen and unseen.
|
|
2808
2730
|
*/
|
|
2809
|
-
|
|
2731
|
+
readonly onViewUpdated: Event<{
|
|
2732
|
+
seen: Set<THREE.Mesh>;
|
|
2733
|
+
unseen: Set<THREE.Mesh>;
|
|
2734
|
+
}>;
|
|
2810
2735
|
/**
|
|
2811
|
-
*
|
|
2736
|
+
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
2737
|
+
* Default value is 100.
|
|
2812
2738
|
*/
|
|
2813
|
-
|
|
2739
|
+
threshold: number;
|
|
2814
2740
|
/**
|
|
2815
|
-
*
|
|
2741
|
+
* Map of color code to THREE.InstancedMesh.
|
|
2742
|
+
* Used to keep track of color-coded meshes.
|
|
2816
2743
|
*/
|
|
2817
|
-
|
|
2744
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
2818
2745
|
/**
|
|
2819
|
-
*
|
|
2746
|
+
* Flag to indicate if the renderer is currently processing.
|
|
2747
|
+
* Used to prevent concurrent processing.
|
|
2820
2748
|
*/
|
|
2821
|
-
|
|
2749
|
+
isProcessing: boolean;
|
|
2750
|
+
private _colorCodeMeshMap;
|
|
2751
|
+
private _meshIDColorCodeMap;
|
|
2752
|
+
private _currentVisibleMeshes;
|
|
2753
|
+
private _recentlyHiddenMeshes;
|
|
2754
|
+
private _intervalID;
|
|
2755
|
+
private readonly _transparentMat;
|
|
2756
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
2757
|
+
/** {@link Disposable.dispose} */
|
|
2758
|
+
dispose(): void;
|
|
2822
2759
|
/**
|
|
2823
|
-
*
|
|
2760
|
+
* Adds a mesh to the culler. When the mesh is not visibile anymore, it will be removed from the scene. When it's visible again, it will be added to the scene.
|
|
2761
|
+
* @param mesh - The mesh to add. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2762
|
+
* @returns {void}
|
|
2824
2763
|
*/
|
|
2825
|
-
|
|
2764
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2826
2765
|
/**
|
|
2827
|
-
*
|
|
2766
|
+
* Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
|
|
2767
|
+
* When the mesh is removed, it will be hidden from the scene and its color-coded mesh will be destroyed.
|
|
2768
|
+
* @param mesh - The mesh to remove. It can be a regular THREE.Mesh or an instance of THREE.InstancedMesh.
|
|
2769
|
+
* @returns {void}
|
|
2828
2770
|
*/
|
|
2829
|
-
|
|
2771
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
2772
|
+
private handleWorkerMessage;
|
|
2773
|
+
private getAvailableMaterial;
|
|
2830
2774
|
}
|
|
2831
2775
|
import * as THREE from "three";
|
|
2832
2776
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer, Disposable, Updateable } from "../../Types";
|
|
@@ -2908,69 +2852,10 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
2908
2852
|
dispose(disposeResources?: boolean): void;
|
|
2909
2853
|
}
|
|
2910
2854
|
import * as THREE from "three";
|
|
2911
|
-
import {
|
|
2855
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
2912
2856
|
import { Components } from "../../Components";
|
|
2913
2857
|
/**
|
|
2914
|
-
*
|
|
2915
|
-
*/
|
|
2916
|
-
export interface SimpleSceneConfig {
|
|
2917
|
-
directionalLight: {
|
|
2918
|
-
color: THREE.Color;
|
|
2919
|
-
intensity: number;
|
|
2920
|
-
position: THREE.Vector3;
|
|
2921
|
-
};
|
|
2922
|
-
ambientLight: {
|
|
2923
|
-
color: THREE.Color;
|
|
2924
|
-
intensity: number;
|
|
2925
|
-
};
|
|
2926
|
-
}
|
|
2927
|
-
/**
|
|
2928
|
-
* 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.
|
|
2929
|
-
*/
|
|
2930
|
-
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
2931
|
-
/** {@link Configurable.isSetup} */
|
|
2932
|
-
isSetup: boolean;
|
|
2933
|
-
/**
|
|
2934
|
-
* The underlying Three.js scene object.
|
|
2935
|
-
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
2936
|
-
*/
|
|
2937
|
-
three: THREE.Scene;
|
|
2938
|
-
/** {@link Configurable.onSetup} */
|
|
2939
|
-
readonly onSetup: Event<SimpleScene>;
|
|
2940
|
-
/**
|
|
2941
|
-
* Configuration interface for the {@link SimpleScene}.
|
|
2942
|
-
* Defines properties for directional and ambient lights.
|
|
2943
|
-
*/
|
|
2944
|
-
config: Required<SimpleSceneConfig>;
|
|
2945
|
-
constructor(components: Components);
|
|
2946
|
-
/** {@link Configurable.setup} */
|
|
2947
|
-
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
2948
|
-
}
|
|
2949
|
-
import { NavigationMode } from "./types";
|
|
2950
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2951
|
-
/**
|
|
2952
|
-
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
2953
|
-
*/
|
|
2954
|
-
export declare class PlanMode implements NavigationMode {
|
|
2955
|
-
private camera;
|
|
2956
|
-
/** {@link NavigationMode.enabled} */
|
|
2957
|
-
enabled: boolean;
|
|
2958
|
-
/** {@link NavigationMode.id} */
|
|
2959
|
-
readonly id = "Plan";
|
|
2960
|
-
private mouseAction1?;
|
|
2961
|
-
private mouseAction2?;
|
|
2962
|
-
private mouseInitialized;
|
|
2963
|
-
private readonly defaultAzimuthSpeed;
|
|
2964
|
-
private readonly defaultPolarSpeed;
|
|
2965
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2966
|
-
/** {@link NavigationMode.set} */
|
|
2967
|
-
set(active: boolean): void;
|
|
2968
|
-
}
|
|
2969
|
-
import * as THREE from "three";
|
|
2970
|
-
import { BaseRenderer, Event } from "../../Types";
|
|
2971
|
-
import { Components } from "../../Components";
|
|
2972
|
-
/**
|
|
2973
|
-
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2858
|
+
* A basic renderer capable of rendering [Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
2974
2859
|
*/
|
|
2975
2860
|
export declare class SimpleRenderer extends BaseRenderer {
|
|
2976
2861
|
/**
|
|
@@ -3021,241 +2906,251 @@ export declare class SimpleRenderer extends BaseRenderer {
|
|
|
3021
2906
|
private onContextBack;
|
|
3022
2907
|
}
|
|
3023
2908
|
import * as THREE from "three";
|
|
3024
|
-
import {
|
|
3025
|
-
import { Event } from "../../Types";
|
|
3026
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
2909
|
+
import { Components } from "../../Components";
|
|
2910
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
3027
2911
|
/**
|
|
3028
|
-
*
|
|
2912
|
+
* Settings to configure the CullerRenderer.
|
|
3029
2913
|
*/
|
|
3030
|
-
export
|
|
3031
|
-
/**
|
|
3032
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
3033
|
-
*/
|
|
3034
|
-
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
2914
|
+
export interface CullerRendererSettings {
|
|
3035
2915
|
/**
|
|
3036
|
-
*
|
|
3037
|
-
* Default is
|
|
2916
|
+
* Interval in milliseconds at which the visibility check should be performed.
|
|
2917
|
+
* Default value is 1000.
|
|
3038
2918
|
*/
|
|
3039
|
-
|
|
2919
|
+
updateInterval?: number;
|
|
3040
2920
|
/**
|
|
3041
|
-
*
|
|
3042
|
-
*
|
|
2921
|
+
* Width of the render target used for visibility checks.
|
|
2922
|
+
* Default value is 512.
|
|
3043
2923
|
*/
|
|
3044
|
-
|
|
3045
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3046
|
-
matchOrthoDistanceEnabled: boolean;
|
|
3047
|
-
private _component;
|
|
3048
|
-
private _previousDistance;
|
|
3049
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
2924
|
+
width?: number;
|
|
3050
2925
|
/**
|
|
3051
|
-
*
|
|
3052
|
-
*
|
|
3053
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
3054
|
-
* it will have no effect.
|
|
2926
|
+
* Height of the render target used for visibility checks.
|
|
2927
|
+
* Default value is 512.
|
|
3055
2928
|
*/
|
|
3056
|
-
|
|
2929
|
+
height?: number;
|
|
3057
2930
|
/**
|
|
3058
|
-
*
|
|
3059
|
-
*
|
|
2931
|
+
* Whether the visibility check should be performed automatically.
|
|
2932
|
+
* Default value is true.
|
|
3060
2933
|
*/
|
|
3061
|
-
|
|
3062
|
-
private setOrthoCamera;
|
|
3063
|
-
private getPerspectiveDims;
|
|
3064
|
-
private setupOrthoCamera;
|
|
3065
|
-
private getDistance;
|
|
3066
|
-
private setPerspectiveCamera;
|
|
2934
|
+
autoUpdate?: boolean;
|
|
3067
2935
|
}
|
|
3068
2936
|
/**
|
|
3069
|
-
*
|
|
3070
|
-
*/
|
|
3071
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3072
|
-
/**
|
|
3073
|
-
* The extensible list of supported navigation modes.
|
|
3074
|
-
*/
|
|
3075
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3076
|
-
/**
|
|
3077
|
-
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
2937
|
+
* A base renderer to determine visibility on screen.
|
|
3078
2938
|
*/
|
|
3079
|
-
export
|
|
3080
|
-
/**
|
|
3081
|
-
|
|
2939
|
+
export declare class CullerRenderer {
|
|
2940
|
+
/** {@link Disposable.onDisposed} */
|
|
2941
|
+
readonly onDisposed: Event<string>;
|
|
3082
2942
|
/**
|
|
3083
|
-
*
|
|
3084
|
-
*
|
|
3085
|
-
*
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
*
|
|
3090
|
-
|
|
3091
|
-
/** Whether this navigation mode is active or not. */
|
|
3092
|
-
enabled: boolean;
|
|
3093
|
-
}
|
|
3094
|
-
import * as THREE from "three";
|
|
3095
|
-
import { Components } from "../../Components";
|
|
3096
|
-
import { Event, World, Disposable } from "../../Types";
|
|
3097
|
-
import { Mouse } from "./mouse";
|
|
3098
|
-
/**
|
|
3099
|
-
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
|
|
3100
|
-
*/
|
|
3101
|
-
export declare class SimpleRaycaster implements Disposable {
|
|
3102
|
-
/** {@link Component.enabled} */
|
|
2943
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
2944
|
+
* meshes that are currently visible, and the ones that were visible
|
|
2945
|
+
* just before but not anymore.
|
|
2946
|
+
*/
|
|
2947
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Whether this renderer is active or not. If not, it won't render anything.
|
|
2950
|
+
*/
|
|
3103
2951
|
enabled: boolean;
|
|
3104
|
-
/** The components instance to which this Raycaster belongs. */
|
|
3105
|
-
components: Components;
|
|
3106
|
-
/** {@link Disposable.onDisposed} */
|
|
3107
|
-
readonly onDisposed: Event<unknown>;
|
|
3108
|
-
/** The position of the mouse in the screen. */
|
|
3109
|
-
readonly mouse: Mouse;
|
|
3110
2952
|
/**
|
|
3111
|
-
*
|
|
3112
|
-
*
|
|
2953
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
2954
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
3113
2955
|
*/
|
|
3114
|
-
|
|
2956
|
+
needsUpdate: boolean;
|
|
3115
2957
|
/**
|
|
3116
|
-
*
|
|
3117
|
-
*
|
|
2958
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
2959
|
+
* for debugging purposes.
|
|
3118
2960
|
*/
|
|
3119
|
-
|
|
3120
|
-
|
|
2961
|
+
renderDebugFrame: boolean;
|
|
2962
|
+
/** The components instance to which this renderer belongs. */
|
|
2963
|
+
components: Components;
|
|
2964
|
+
/** The world instance to which this renderer belongs. */
|
|
2965
|
+
readonly world: World;
|
|
2966
|
+
/** The THREE.js renderer used to make the visibility test. */
|
|
2967
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
2968
|
+
protected autoUpdate: boolean;
|
|
2969
|
+
protected updateInterval: number;
|
|
2970
|
+
protected readonly worker: Worker;
|
|
2971
|
+
protected readonly scene: THREE.Scene;
|
|
2972
|
+
private _width;
|
|
2973
|
+
private _height;
|
|
2974
|
+
private _availableColor;
|
|
2975
|
+
private readonly renderTarget;
|
|
2976
|
+
private readonly bufferSize;
|
|
2977
|
+
private readonly _buffer;
|
|
2978
|
+
protected _isWorkerBusy: boolean;
|
|
2979
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
3121
2980
|
/** {@link Disposable.dispose} */
|
|
3122
2981
|
dispose(): void;
|
|
3123
2982
|
/**
|
|
3124
|
-
*
|
|
3125
|
-
*
|
|
3126
|
-
*
|
|
3127
|
-
*
|
|
3128
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
3129
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
3130
|
-
* {@link Components.meshes}.
|
|
3131
|
-
*/
|
|
3132
|
-
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
3133
|
-
/**
|
|
3134
|
-
* Casts a ray from a given origin in a given direction and returns the first item found.
|
|
3135
|
-
* This method also takes into account the clipping planes used by the renderer.
|
|
3136
|
-
*
|
|
3137
|
-
* @param origin - The origin of the ray.
|
|
3138
|
-
* @param direction - The direction of the ray.
|
|
3139
|
-
* @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
|
|
3140
|
-
* @returns The first intersection found or 'null' if no intersection was found.
|
|
2983
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
2984
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
2985
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
2986
|
+
* not true.
|
|
3141
2987
|
*/
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
2988
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
2989
|
+
protected getAvailableColor(): {
|
|
2990
|
+
r: number;
|
|
2991
|
+
g: number;
|
|
2992
|
+
b: number;
|
|
2993
|
+
code: string;
|
|
2994
|
+
};
|
|
2995
|
+
protected increaseColor(): void;
|
|
2996
|
+
protected decreaseColor(): void;
|
|
2997
|
+
private applySettings;
|
|
3145
2998
|
}
|
|
3146
2999
|
import * as THREE from "three";
|
|
3147
|
-
import {
|
|
3000
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
3001
|
+
import { Components } from "../../Components";
|
|
3148
3002
|
/**
|
|
3149
|
-
*
|
|
3003
|
+
* Configuration interface for the {@link SimpleScene}. Defines properties for directional and ambient lights.
|
|
3150
3004
|
*/
|
|
3151
|
-
export
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
get position(): THREE.Vector2;
|
|
3162
|
-
/** {@link Disposable.dispose} */
|
|
3163
|
-
dispose(): void;
|
|
3164
|
-
private getPositionY;
|
|
3165
|
-
private getPositionX;
|
|
3166
|
-
private updateMouseInfo;
|
|
3167
|
-
private setupEvents;
|
|
3005
|
+
export interface SimpleSceneConfig {
|
|
3006
|
+
directionalLight: {
|
|
3007
|
+
color: THREE.Color;
|
|
3008
|
+
intensity: number;
|
|
3009
|
+
position: THREE.Vector3;
|
|
3010
|
+
};
|
|
3011
|
+
ambientLight: {
|
|
3012
|
+
color: THREE.Color;
|
|
3013
|
+
intensity: number;
|
|
3014
|
+
};
|
|
3168
3015
|
}
|
|
3169
|
-
import { NavigationMode } from "./types";
|
|
3170
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
3171
3016
|
/**
|
|
3172
|
-
* A
|
|
3017
|
+
* 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.
|
|
3173
3018
|
*/
|
|
3174
|
-
export declare class
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3019
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
3020
|
+
/** {@link Configurable.isSetup} */
|
|
3021
|
+
isSetup: boolean;
|
|
3022
|
+
/**
|
|
3023
|
+
* The underlying Three.js scene object.
|
|
3024
|
+
* It is used to define the 3D space containing objects, lights, and cameras.
|
|
3025
|
+
*/
|
|
3026
|
+
three: THREE.Scene;
|
|
3027
|
+
/** {@link Configurable.onSetup} */
|
|
3028
|
+
readonly onSetup: Event<SimpleScene>;
|
|
3029
|
+
/**
|
|
3030
|
+
* Configuration interface for the {@link SimpleScene}.
|
|
3031
|
+
* Defines properties for directional and ambient lights.
|
|
3032
|
+
*/
|
|
3033
|
+
config: Required<SimpleSceneConfig>;
|
|
3034
|
+
constructor(components: Components);
|
|
3035
|
+
/** {@link Configurable.setup} */
|
|
3036
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
3184
3037
|
}
|
|
3185
|
-
import
|
|
3186
|
-
import
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3038
|
+
import * as THREE from "three";
|
|
3039
|
+
import * as WEBIFC from "web-ifc";
|
|
3040
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
3041
|
+
export declare class CivilReader {
|
|
3042
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
3043
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
3044
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3045
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3046
|
+
} | undefined;
|
|
3047
|
+
get(civilItems: any): {
|
|
3048
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
3049
|
+
coordinationMatrix: THREE.Matrix4;
|
|
3050
|
+
} | undefined;
|
|
3051
|
+
private getCurves;
|
|
3052
|
+
}
|
|
3053
|
+
import * as WEBIFC from "web-ifc";
|
|
3054
|
+
export declare class IfcMetadataReader {
|
|
3055
|
+
getNameInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3056
|
+
getDescriptionInfo(webIfc: WEBIFC.IfcAPI): Record<string, any>;
|
|
3200
3057
|
}
|
|
3201
3058
|
import * as THREE from "three";
|
|
3202
|
-
import { Hideable, Event, World
|
|
3059
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3203
3060
|
import { Components } from "../../Components";
|
|
3204
3061
|
/**
|
|
3205
|
-
*
|
|
3062
|
+
* Each of the clipping planes created by the clipper.
|
|
3206
3063
|
*/
|
|
3207
|
-
export
|
|
3208
|
-
/**
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3064
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
3065
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
3066
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
3067
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
3068
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
3069
|
+
/** {@link Disposable.onDisposed} */
|
|
3070
|
+
readonly onDisposed: Event<unknown>;
|
|
3212
3071
|
/**
|
|
3213
|
-
* The
|
|
3072
|
+
* The normal vector of the clipping plane.
|
|
3214
3073
|
*/
|
|
3215
|
-
|
|
3074
|
+
readonly normal: THREE.Vector3;
|
|
3216
3075
|
/**
|
|
3217
|
-
* The
|
|
3076
|
+
* The origin point of the clipping plane.
|
|
3218
3077
|
*/
|
|
3219
|
-
|
|
3078
|
+
readonly origin: THREE.Vector3;
|
|
3220
3079
|
/**
|
|
3221
|
-
* The
|
|
3080
|
+
* The THREE.js Plane object representing the clipping plane.
|
|
3222
3081
|
*/
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
/**
|
|
3226
|
-
* An infinite grid. Created by [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper) and translated to typescript by [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
3227
|
-
*/
|
|
3228
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
3229
|
-
/** {@link Disposable.onDisposed} */
|
|
3230
|
-
readonly onDisposed: Event<unknown>;
|
|
3231
|
-
/** The world instance to which this Raycaster belongs. */
|
|
3232
|
-
world: World;
|
|
3233
|
-
/** The components instance to which this grid belongs. */
|
|
3082
|
+
readonly three: THREE.Plane;
|
|
3083
|
+
/** The components instance to which this plane belongs. */
|
|
3234
3084
|
components: Components;
|
|
3235
|
-
/**
|
|
3085
|
+
/** The world instance to which this plane belongs. */
|
|
3086
|
+
world: World;
|
|
3087
|
+
protected readonly _helper: THREE.Object3D;
|
|
3088
|
+
protected _visible: boolean;
|
|
3089
|
+
protected _enabled: boolean;
|
|
3090
|
+
private _controlsActive;
|
|
3091
|
+
private readonly _arrowBoundBox;
|
|
3092
|
+
private readonly _planeMesh;
|
|
3093
|
+
private readonly _controls;
|
|
3094
|
+
private readonly _hiddenMaterial;
|
|
3095
|
+
/**
|
|
3096
|
+
* Getter for the enabled state of the clipping plane.
|
|
3097
|
+
* @returns {boolean} The current enabled state.
|
|
3098
|
+
*/
|
|
3099
|
+
get enabled(): boolean;
|
|
3100
|
+
/**
|
|
3101
|
+
* Setter for the enabled state of the clipping plane.
|
|
3102
|
+
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
3103
|
+
* @param {boolean} state - The new enabled state.
|
|
3104
|
+
*/
|
|
3105
|
+
set enabled(state: boolean);
|
|
3106
|
+
/** {@link Hideable.visible } */
|
|
3236
3107
|
get visible(): boolean;
|
|
3237
|
-
/** {@link Hideable.visible} */
|
|
3238
|
-
set visible(
|
|
3239
|
-
/** The
|
|
3240
|
-
get
|
|
3108
|
+
/** {@link Hideable.visible } */
|
|
3109
|
+
set visible(state: boolean);
|
|
3110
|
+
/** The meshes used for raycasting */
|
|
3111
|
+
get meshes(): THREE.Mesh[];
|
|
3112
|
+
/** The material of the clipping plane representation. */
|
|
3113
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
3114
|
+
/** The material of the clipping plane representation. */
|
|
3115
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
3116
|
+
/** The size of the clipping plane representation. */
|
|
3117
|
+
get size(): number;
|
|
3118
|
+
/** Sets the size of the clipping plane representation. */
|
|
3119
|
+
set size(size: number);
|
|
3241
3120
|
/**
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3121
|
+
* Getter for the helper object of the clipping plane.
|
|
3122
|
+
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
3123
|
+
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
3124
|
+
*
|
|
3125
|
+
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
3244
3126
|
*/
|
|
3245
|
-
get
|
|
3127
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3128
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
3246
3129
|
/**
|
|
3247
|
-
*
|
|
3248
|
-
*
|
|
3130
|
+
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
3131
|
+
* This method resets the clipping plane's state, updates the normal and origin,
|
|
3132
|
+
* and positions the helper object accordingly.
|
|
3133
|
+
*
|
|
3134
|
+
* @param normal - The new normal vector for the clipping plane.
|
|
3135
|
+
* @param point - The new origin point for the clipping plane.
|
|
3136
|
+
*
|
|
3137
|
+
* @returns {void}
|
|
3249
3138
|
*/
|
|
3250
|
-
|
|
3251
|
-
/**
|
|
3252
|
-
|
|
3253
|
-
private _fade;
|
|
3254
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
3139
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
3140
|
+
/** {@link Updateable.update} */
|
|
3141
|
+
update: () => void;
|
|
3255
3142
|
/** {@link Disposable.dispose} */
|
|
3256
3143
|
dispose(): void;
|
|
3257
|
-
private
|
|
3258
|
-
|
|
3144
|
+
private reset;
|
|
3145
|
+
protected toggleControls(state: boolean): void;
|
|
3146
|
+
private newTransformControls;
|
|
3147
|
+
private initializeControls;
|
|
3148
|
+
private createArrowBoundingBox;
|
|
3149
|
+
private changeDrag;
|
|
3150
|
+
private notifyDraggingChanged;
|
|
3151
|
+
private preventCameraMovement;
|
|
3152
|
+
private newHelper;
|
|
3153
|
+
private static newPlaneMesh;
|
|
3259
3154
|
}
|
|
3260
3155
|
import * as THREE from "three";
|
|
3261
3156
|
import CameraControls from "camera-controls";
|
|
@@ -3319,6 +3214,139 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
3319
3214
|
private setupEvents;
|
|
3320
3215
|
private static getSubsetOfThree;
|
|
3321
3216
|
}
|
|
3217
|
+
import { NavigationMode } from "./types";
|
|
3218
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3219
|
+
/**
|
|
3220
|
+
* A {@link NavigationMode} that allows first person navigation, simulating FPS video games.
|
|
3221
|
+
*/
|
|
3222
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
3223
|
+
private camera;
|
|
3224
|
+
/** {@link NavigationMode.enabled} */
|
|
3225
|
+
enabled: boolean;
|
|
3226
|
+
/** {@link NavigationMode.id} */
|
|
3227
|
+
readonly id = "FirstPerson";
|
|
3228
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3229
|
+
/** {@link NavigationMode.set} */
|
|
3230
|
+
set(active: boolean): void;
|
|
3231
|
+
private setupFirstPersonCamera;
|
|
3232
|
+
}
|
|
3233
|
+
import * as WEBIFC from "web-ifc";
|
|
3234
|
+
import * as THREE from "three";
|
|
3235
|
+
export declare class Units {
|
|
3236
|
+
factor: number;
|
|
3237
|
+
complement: number;
|
|
3238
|
+
apply(matrix: THREE.Matrix4): void;
|
|
3239
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
3240
|
+
private getLengthUnits;
|
|
3241
|
+
private getScaleMatrix;
|
|
3242
|
+
}
|
|
3243
|
+
import { NavigationMode } from "./types";
|
|
3244
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3245
|
+
/**
|
|
3246
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
|
|
3247
|
+
*/
|
|
3248
|
+
export declare class PlanMode implements NavigationMode {
|
|
3249
|
+
private camera;
|
|
3250
|
+
/** {@link NavigationMode.enabled} */
|
|
3251
|
+
enabled: boolean;
|
|
3252
|
+
/** {@link NavigationMode.id} */
|
|
3253
|
+
readonly id = "Plan";
|
|
3254
|
+
private mouseAction1?;
|
|
3255
|
+
private mouseAction2?;
|
|
3256
|
+
private mouseInitialized;
|
|
3257
|
+
private readonly defaultAzimuthSpeed;
|
|
3258
|
+
private readonly defaultPolarSpeed;
|
|
3259
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3260
|
+
/** {@link NavigationMode.set} */
|
|
3261
|
+
set(active: boolean): void;
|
|
3262
|
+
}
|
|
3263
|
+
/**
|
|
3264
|
+
* The projection system of the camera.
|
|
3265
|
+
*/
|
|
3266
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
3267
|
+
/**
|
|
3268
|
+
* The extensible list of supported navigation modes.
|
|
3269
|
+
*/
|
|
3270
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
3271
|
+
/**
|
|
3272
|
+
* An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
3273
|
+
*/
|
|
3274
|
+
export interface NavigationMode {
|
|
3275
|
+
/** The unique ID of this navigation mode. */
|
|
3276
|
+
id: NavModeID;
|
|
3277
|
+
/**
|
|
3278
|
+
* Enable or disable this navigation mode.
|
|
3279
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
3280
|
+
* must be disabled.
|
|
3281
|
+
*
|
|
3282
|
+
* @param active - whether to enable or disable this mode.
|
|
3283
|
+
* @param options - any additional data required to enable or disable it.
|
|
3284
|
+
* */
|
|
3285
|
+
set: (active: boolean, options?: any) => void;
|
|
3286
|
+
/** Whether this navigation mode is active or not. */
|
|
3287
|
+
enabled: boolean;
|
|
3288
|
+
}
|
|
3289
|
+
import * as THREE from "three";
|
|
3290
|
+
import { CameraProjection } from "./types";
|
|
3291
|
+
import { Event } from "../../Types";
|
|
3292
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3293
|
+
/**
|
|
3294
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3295
|
+
*/
|
|
3296
|
+
export declare class ProjectionManager {
|
|
3297
|
+
/**
|
|
3298
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
3299
|
+
*/
|
|
3300
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
3301
|
+
/**
|
|
3302
|
+
* Current projection mode of the camera.
|
|
3303
|
+
* Default is "Perspective".
|
|
3304
|
+
*/
|
|
3305
|
+
current: CameraProjection;
|
|
3306
|
+
/**
|
|
3307
|
+
* The camera controlled by this ProjectionManager.
|
|
3308
|
+
* It can be either a PerspectiveCamera or an OrthographicCamera.
|
|
3309
|
+
*/
|
|
3310
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
3311
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
3312
|
+
matchOrthoDistanceEnabled: boolean;
|
|
3313
|
+
private _component;
|
|
3314
|
+
private _previousDistance;
|
|
3315
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3316
|
+
/**
|
|
3317
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
3318
|
+
*
|
|
3319
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
3320
|
+
* it will have no effect.
|
|
3321
|
+
*/
|
|
3322
|
+
set(projection: CameraProjection): Promise<void>;
|
|
3323
|
+
/**
|
|
3324
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
3325
|
+
* and vice versa.
|
|
3326
|
+
*/
|
|
3327
|
+
toggle(): Promise<void>;
|
|
3328
|
+
private setOrthoCamera;
|
|
3329
|
+
private getPerspectiveDims;
|
|
3330
|
+
private setupOrthoCamera;
|
|
3331
|
+
private getDistance;
|
|
3332
|
+
private setPerspectiveCamera;
|
|
3333
|
+
}
|
|
3334
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3335
|
+
/**
|
|
3336
|
+
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3337
|
+
*/
|
|
3338
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
3339
|
+
/**
|
|
3340
|
+
* Minimum number of geometries to be streamed.
|
|
3341
|
+
* Defaults to 10 geometries.
|
|
3342
|
+
*/
|
|
3343
|
+
minGeometrySize: number;
|
|
3344
|
+
/**
|
|
3345
|
+
* Minimum amount of assets to be streamed.
|
|
3346
|
+
* Defaults to 1000 assets.
|
|
3347
|
+
*/
|
|
3348
|
+
minAssetsSize: number;
|
|
3349
|
+
}
|
|
3322
3350
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
3323
3351
|
export interface ModelsRelationMap {
|
|
3324
3352
|
[modelID: string]: RelationsMap;
|
|
@@ -3343,10 +3371,66 @@ export type InverseAttributes = [
|
|
|
3343
3371
|
"ContainsElements"
|
|
3344
3372
|
];
|
|
3345
3373
|
export type InverseAttribute = InverseAttributes[number];
|
|
3374
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
3375
|
+
/**
|
|
3376
|
+
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
3377
|
+
*/
|
|
3378
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
3379
|
+
/**
|
|
3380
|
+
* Amount of properties to be streamed.
|
|
3381
|
+
* Defaults to 100 properties.
|
|
3382
|
+
*/
|
|
3383
|
+
propertiesSize: number;
|
|
3384
|
+
}
|
|
3385
|
+
import { NavigationMode } from "./types";
|
|
3386
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
3387
|
+
/**
|
|
3388
|
+
* A {@link NavigationMode} that allows 3D navigation and panning like in many 3D and CAD softwares.
|
|
3389
|
+
*/
|
|
3390
|
+
export declare class OrbitMode implements NavigationMode {
|
|
3391
|
+
camera: OrthoPerspectiveCamera;
|
|
3392
|
+
/** {@link NavigationMode.enabled} */
|
|
3393
|
+
enabled: boolean;
|
|
3394
|
+
/** {@link NavigationMode.id} */
|
|
3395
|
+
readonly id = "Orbit";
|
|
3396
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
3397
|
+
/** {@link NavigationMode.set} */
|
|
3398
|
+
set(active: boolean): void;
|
|
3399
|
+
private activateOrbitControls;
|
|
3400
|
+
}
|
|
3346
3401
|
import { BufferGeometry } from "three";
|
|
3347
3402
|
import * as THREE from "three";
|
|
3348
3403
|
export declare class TransformHelper {
|
|
3349
3404
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
3350
3405
|
}
|
|
3406
|
+
/**
|
|
3407
|
+
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3408
|
+
*/
|
|
3409
|
+
export interface StreamedGeometries {
|
|
3410
|
+
[id: number]: {
|
|
3411
|
+
/** The bounding box of the geometry as a Float32Array. */
|
|
3412
|
+
boundingBox: Float32Array;
|
|
3413
|
+
/** A boolean indicating whether the geometry has holes. */
|
|
3414
|
+
hasHoles: boolean;
|
|
3415
|
+
/** An optional file path for the geometry data. */
|
|
3416
|
+
geometryFile?: string;
|
|
3417
|
+
};
|
|
3418
|
+
}
|
|
3419
|
+
/**
|
|
3420
|
+
* A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
|
|
3421
|
+
*/
|
|
3422
|
+
export interface StreamedAsset {
|
|
3423
|
+
/** The unique identifier of the asset. */
|
|
3424
|
+
id: number;
|
|
3425
|
+
/** An array of geometries associated with the asset. */
|
|
3426
|
+
geometries: {
|
|
3427
|
+
/** The unique identifier of the geometry. */
|
|
3428
|
+
geometryID: number;
|
|
3429
|
+
/** The transformation matrix of the geometry as a number array. */
|
|
3430
|
+
transformation: number[];
|
|
3431
|
+
/** The color of the geometry as a number array. */
|
|
3432
|
+
color: number[];
|
|
3433
|
+
}[];
|
|
3434
|
+
}
|
|
3351
3435
|
|
|
3352
3436
|
}
|