@thatopen/components 2.0.0-alpha.11 → 2.0.0-alpha.12
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/namespace.d.ts +1171 -1171
- package/package.json +1 -1
package/dist/namespace.d.ts
CHANGED
|
@@ -1,203 +1,491 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
2
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
3
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
4
|
+
export declare class FragmentExploder extends Component implements Disposable {
|
|
5
|
+
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
7
6
|
enabled: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
constructor(components: Components);
|
|
11
|
-
get(world: World): SimpleRaycaster;
|
|
12
|
-
delete(world: World): void;
|
|
13
|
-
dispose(): void;
|
|
14
|
-
}
|
|
15
|
-
import { Component, Disposable, Event } from "../Types";
|
|
16
|
-
/**
|
|
17
|
-
* The entry point of the Components library.
|
|
18
|
-
* It can:
|
|
19
|
-
* - Create and access all the components of the library.
|
|
20
|
-
* - Update all the updatable components automatically.
|
|
21
|
-
* - Dispose all the components, preventing memory leaks.
|
|
22
|
-
*/
|
|
23
|
-
export declare class Components implements Disposable {
|
|
24
|
-
static readonly release = "1.4.21";
|
|
7
|
+
height: number;
|
|
8
|
+
groupName: string;
|
|
25
9
|
/** {@link Disposable.onDisposed} */
|
|
26
|
-
readonly onDisposed: Event<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/** If disabled, the animation loop will be stopped. */
|
|
30
|
-
enabled: boolean;
|
|
31
|
-
private _clock;
|
|
32
|
-
add(uuid: string, instance: Component): void;
|
|
33
|
-
/**
|
|
34
|
-
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
35
|
-
* doesn't exist, it will instance it automatically.
|
|
36
|
-
*
|
|
37
|
-
* @param Component - The component to get or create.
|
|
38
|
-
*/
|
|
39
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
40
|
-
constructor();
|
|
41
|
-
/**
|
|
42
|
-
* Initializes the library. It should be called at the start of the app after
|
|
43
|
-
* initializing the scene, the renderer and the
|
|
44
|
-
* camera. Additionally, if any component that need a raycaster is
|
|
45
|
-
* used, the {@link raycaster} will need to be initialized.
|
|
46
|
-
*/
|
|
47
|
-
init(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
50
|
-
* the library. A memory leak will be created if:
|
|
51
|
-
*
|
|
52
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
53
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
54
|
-
* Angular, Vue, etc).
|
|
55
|
-
*
|
|
56
|
-
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
57
|
-
* referenced by a reference type (object or array).
|
|
58
|
-
*
|
|
59
|
-
* You can learn more about how Three.js handles memory leaks
|
|
60
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
10
|
+
readonly onDisposed: Event<string>;
|
|
11
|
+
list: Set<string>;
|
|
12
|
+
constructor(components: Components);
|
|
63
13
|
dispose(): void;
|
|
64
|
-
|
|
65
|
-
|
|
14
|
+
explode(): void;
|
|
15
|
+
reset(): void;
|
|
16
|
+
update(): void;
|
|
66
17
|
}
|
|
67
18
|
import * as THREE from "three";
|
|
68
|
-
import
|
|
69
|
-
import {
|
|
19
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
20
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
21
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
70
22
|
/**
|
|
71
|
-
* A
|
|
72
|
-
*
|
|
23
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
24
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
73
25
|
*/
|
|
74
|
-
export declare class
|
|
75
|
-
|
|
26
|
+
export declare class BoundingBoxes extends Component implements Disposable {
|
|
27
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
76
28
|
/** {@link Component.enabled} */
|
|
77
29
|
enabled: boolean;
|
|
78
|
-
|
|
30
|
+
/** {@link Disposable.onDisposed} */
|
|
31
|
+
readonly onDisposed: Event<unknown>;
|
|
32
|
+
private _absoluteMin;
|
|
33
|
+
private _absoluteMax;
|
|
34
|
+
private _meshes;
|
|
79
35
|
constructor(components: Components);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
*
|
|
90
|
-
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
91
|
-
* to remove.
|
|
92
|
-
*
|
|
93
|
-
* @param materials - whether to dispose the materials of the mesh.
|
|
94
|
-
*
|
|
95
|
-
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
96
|
-
*/
|
|
97
|
-
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
98
|
-
/**
|
|
99
|
-
* Disposes a geometry from memory.
|
|
100
|
-
*
|
|
101
|
-
* @param geometry - the
|
|
102
|
-
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
103
|
-
* to remove.
|
|
104
|
-
*/
|
|
105
|
-
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
106
|
-
private disposeGeometryAndMaterials;
|
|
107
|
-
private disposeChildren;
|
|
108
|
-
private static disposeMaterial;
|
|
109
|
-
}
|
|
110
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
111
|
-
import { GridConfig, SimpleGrid } from "./src";
|
|
112
|
-
export declare class Grids extends Component implements Disposable {
|
|
113
|
-
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
114
|
-
list: Map<string, SimpleGrid>;
|
|
115
|
-
onDisposed: Event<unknown>;
|
|
116
|
-
config: Required<GridConfig>;
|
|
117
|
-
/** {@link Component.enabled} */
|
|
118
|
-
enabled: boolean;
|
|
119
|
-
create(world: World): void;
|
|
120
|
-
delete(world: World): void;
|
|
36
|
+
static getDimensions(bbox: THREE.Box3): {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
depth: number;
|
|
40
|
+
center: THREE.Vector3;
|
|
41
|
+
};
|
|
42
|
+
static newBound(positive: boolean): THREE.Vector3;
|
|
43
|
+
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
44
|
+
/** {@link Disposable.dispose} */
|
|
121
45
|
dispose(): void;
|
|
46
|
+
get(): THREE.Box3;
|
|
47
|
+
getSphere(): THREE.Sphere;
|
|
48
|
+
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
49
|
+
reset(): void;
|
|
50
|
+
add(group: FragmentsGroup): void;
|
|
51
|
+
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
52
|
+
private static getFragmentBounds;
|
|
122
53
|
}
|
|
123
|
-
import
|
|
124
|
-
import { Components } from "
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
128
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
129
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
130
|
-
readonly onDisposed: Event<unknown>;
|
|
131
|
-
list: Map<string, World>;
|
|
54
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
55
|
+
import { Components, Component } from "../../core";
|
|
56
|
+
export declare class FragmentHider extends Component {
|
|
57
|
+
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
132
58
|
enabled: boolean;
|
|
133
59
|
constructor(components: Components);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
update(delta?: number): void | Promise<void>;
|
|
60
|
+
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
61
|
+
isolate(items: FRAGS.FragmentIdMap): void;
|
|
62
|
+
private updateCulledVisibility;
|
|
138
63
|
}
|
|
139
|
-
import
|
|
140
|
-
import
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
readonly
|
|
145
|
-
readonly
|
|
64
|
+
import * as WEBIFC from "web-ifc";
|
|
65
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
66
|
+
import { IfcFragmentSettings } from "./src";
|
|
67
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
68
|
+
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
69
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
70
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
71
|
+
readonly onSetup: Event<void>;
|
|
72
|
+
/** {@link Disposable.onDisposed} */
|
|
73
|
+
readonly onDisposed: Event<string>;
|
|
74
|
+
settings: IfcFragmentSettings;
|
|
146
75
|
enabled: boolean;
|
|
147
|
-
|
|
76
|
+
webIfc: WEBIFC.IfcAPI;
|
|
77
|
+
private _material;
|
|
78
|
+
private _spatialTree;
|
|
79
|
+
private _metaData;
|
|
80
|
+
private _fragmentInstances;
|
|
81
|
+
private _civil;
|
|
82
|
+
private _propertyExporter;
|
|
83
|
+
private _visitedFragments;
|
|
84
|
+
private _materialT;
|
|
148
85
|
constructor(components: Components);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
86
|
+
dispose(): void;
|
|
87
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
88
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
89
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
90
|
+
private getAllGeometries;
|
|
91
|
+
cleanUp(): void;
|
|
92
|
+
private getMesh;
|
|
93
|
+
private getGeometry;
|
|
94
|
+
private autoSetWasm;
|
|
153
95
|
}
|
|
154
96
|
import * as THREE from "three";
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
97
|
+
export interface MeasureEdge {
|
|
98
|
+
distance: number;
|
|
99
|
+
points: THREE.Vector3[];
|
|
100
|
+
}
|
|
101
|
+
export declare class MeasurementUtils {
|
|
102
|
+
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
103
|
+
edges: MeasureEdge[];
|
|
104
|
+
indices: Set<number>;
|
|
105
|
+
} | null;
|
|
106
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
107
|
+
private static getFaceData;
|
|
108
|
+
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
109
|
+
p1: THREE.Vector3;
|
|
110
|
+
p2: THREE.Vector3;
|
|
111
|
+
p3: THREE.Vector3;
|
|
112
|
+
faceNormal: THREE.Vector3;
|
|
113
|
+
};
|
|
114
|
+
private static round;
|
|
115
|
+
}
|
|
116
|
+
import * as THREE from "three";
|
|
117
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
118
|
+
import { Disposable, Component, Event, Components } from "../../core";
|
|
119
|
+
export interface Classification {
|
|
120
|
+
[system: string]: {
|
|
121
|
+
[className: string]: FRAGS.FragmentIdMap;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export declare class FragmentClassifier extends Component implements Disposable {
|
|
125
|
+
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
126
|
+
/** {@link Component.enabled} */
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
list: Classification;
|
|
129
|
+
/** {@link Disposable.onDisposed} */
|
|
130
|
+
readonly onDisposed: Event<unknown>;
|
|
131
|
+
constructor(components: Components);
|
|
132
|
+
private onFragmentsDisposed;
|
|
133
|
+
dispose(): void;
|
|
134
|
+
remove(guid: string): void;
|
|
135
|
+
find(filter?: {
|
|
136
|
+
[name: string]: string[];
|
|
137
|
+
}): FRAGS.FragmentIdMap;
|
|
138
|
+
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
139
|
+
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
140
|
+
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
141
|
+
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
142
|
+
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
143
|
+
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
144
|
+
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
145
|
+
private saveItem;
|
|
146
|
+
}
|
|
147
|
+
import * as WEBIFC from "web-ifc";
|
|
148
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
149
|
+
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
150
|
+
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
151
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
152
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
153
|
+
type: number;
|
|
154
|
+
data: {
|
|
155
|
+
[id: number]: any;
|
|
156
|
+
};
|
|
157
|
+
}>;
|
|
158
|
+
onProgress: AsyncEvent<number>;
|
|
159
|
+
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
160
|
+
/** {@link Disposable.onDisposed} */
|
|
161
|
+
readonly onDisposed: Event<string>;
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
settings: PropertiesStreamingSettings;
|
|
164
|
+
webIfc: WEBIFC.IfcAPI;
|
|
165
|
+
dispose(): Promise<void>;
|
|
166
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
167
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
168
|
+
private readIfcFile;
|
|
169
|
+
private streamIfcFile;
|
|
170
|
+
private streamAllProperties;
|
|
171
|
+
private cleanUp;
|
|
172
|
+
}
|
|
173
|
+
import * as WEBIFC from "web-ifc";
|
|
174
|
+
import { Components, Disposable, Event, Component } from "../../core";
|
|
175
|
+
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
176
|
+
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
177
|
+
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
178
|
+
onGeometryStreamed: Event<{
|
|
179
|
+
buffer: Uint8Array;
|
|
180
|
+
data: StreamedGeometries;
|
|
181
|
+
}>;
|
|
182
|
+
onAssetStreamed: Event<StreamedAsset[]>;
|
|
183
|
+
onProgress: Event<number>;
|
|
184
|
+
onIfcLoaded: Event<Uint8Array>;
|
|
185
|
+
/** {@link Disposable.onDisposed} */
|
|
186
|
+
readonly onDisposed: Event<unknown>;
|
|
187
|
+
settings: IfcStreamingSettings;
|
|
188
|
+
enabled: boolean;
|
|
189
|
+
webIfc: WEBIFC.IfcAPI;
|
|
190
|
+
private _spatialTree;
|
|
191
|
+
private _metaData;
|
|
192
|
+
private _visitedGeometries;
|
|
193
|
+
private _streamSerializer;
|
|
194
|
+
private _geometries;
|
|
195
|
+
private _geometryCount;
|
|
196
|
+
private _civil;
|
|
197
|
+
private _groupSerializer;
|
|
198
|
+
private _assets;
|
|
199
|
+
private _meshesWithHoles;
|
|
200
|
+
constructor(components: Components);
|
|
201
|
+
dispose(): void;
|
|
202
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
203
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
204
|
+
private readIfcFile;
|
|
205
|
+
private streamIfcFile;
|
|
206
|
+
private streamAllGeometries;
|
|
207
|
+
private cleanUp;
|
|
208
|
+
private getMesh;
|
|
209
|
+
private getGeometry;
|
|
210
|
+
private streamAssets;
|
|
211
|
+
private streamGeometries;
|
|
212
|
+
}
|
|
213
|
+
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
214
|
+
import * as THREE from "three";
|
|
215
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
216
|
+
/**
|
|
217
|
+
* Object that can efficiently load binary files that contain
|
|
218
|
+
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
219
|
+
*/
|
|
220
|
+
export declare class FragmentManager extends Component implements Disposable {
|
|
221
|
+
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
222
|
+
/** {@link Disposable.onDisposed} */
|
|
223
|
+
readonly onDisposed: Event<unknown>;
|
|
224
|
+
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
225
|
+
readonly onFragmentsDisposed: Event<{
|
|
226
|
+
groupID: string;
|
|
227
|
+
fragmentIDs: string[];
|
|
228
|
+
}>;
|
|
229
|
+
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
230
|
+
readonly list: Map<string, Fragment>;
|
|
231
|
+
readonly groups: Map<string, FragmentsGroup>;
|
|
232
|
+
/** {@link Component.enabled} */
|
|
233
|
+
enabled: boolean;
|
|
234
|
+
baseCoordinationModel: string;
|
|
235
|
+
private _loader;
|
|
236
|
+
/** The list of meshes of the created fragments. */
|
|
237
|
+
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
238
|
+
constructor(components: Components);
|
|
239
|
+
/** {@link Disposable.dispose} */
|
|
240
|
+
dispose(): void;
|
|
241
|
+
disposeGroup(group: FragmentsGroup): void;
|
|
242
|
+
/**
|
|
243
|
+
* Loads one or many fragments into the scene.
|
|
244
|
+
* @param data - the bytes containing the data for the fragments to load.
|
|
245
|
+
* @param coordinate - whether this fragmentsgroup should be federated with the others.
|
|
246
|
+
* @returns the list of IDs of the loaded fragments.
|
|
247
|
+
*/
|
|
248
|
+
load(data: Uint8Array, coordinate?: boolean): FragmentsGroup;
|
|
249
|
+
/**
|
|
250
|
+
* Export the specified fragments.
|
|
251
|
+
* @param group - the fragments group to be exported.
|
|
252
|
+
* @returns the exported data as binary buffer.
|
|
253
|
+
*/
|
|
254
|
+
export(group: FragmentsGroup): Uint8Array;
|
|
255
|
+
coordinate(models?: FragmentsGroup[]): void;
|
|
256
|
+
}
|
|
257
|
+
import * as THREE from "three";
|
|
258
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
259
|
+
center: THREE.Vector3;
|
|
260
|
+
halfSizes: THREE.Vector3;
|
|
261
|
+
rotation: THREE.Matrix3;
|
|
262
|
+
transformation: THREE.Matrix4;
|
|
263
|
+
};
|
|
264
|
+
export declare class UUID {
|
|
265
|
+
private static _pattern;
|
|
266
|
+
private static _lut;
|
|
267
|
+
static create(): string;
|
|
268
|
+
static validate(uuid: string): void;
|
|
269
|
+
}
|
|
270
|
+
import * as THREE from "three";
|
|
271
|
+
import { Component, Components, Event, World, Disposable } from "../core";
|
|
272
|
+
export interface VertexPickerConfig {
|
|
273
|
+
showOnlyVertex: boolean;
|
|
274
|
+
snapDistance: number;
|
|
275
|
+
previewElement: HTMLElement;
|
|
276
|
+
}
|
|
277
|
+
export declare class VertexPicker extends Component implements Disposable {
|
|
278
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
279
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
280
|
+
components: Components;
|
|
281
|
+
private _pickedPoint;
|
|
282
|
+
private _config;
|
|
283
|
+
private _enabled;
|
|
284
|
+
private _workingPlane;
|
|
285
|
+
/** {@link Disposable.onDisposed} */
|
|
286
|
+
readonly onDisposed: Event<unknown>;
|
|
287
|
+
set enabled(value: boolean);
|
|
288
|
+
get enabled(): boolean;
|
|
289
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
290
|
+
[Symbol.dispose](): void;
|
|
291
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
292
|
+
get workingPlane(): THREE.Plane | null;
|
|
293
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
294
|
+
get config(): Partial<VertexPickerConfig>;
|
|
295
|
+
dispose(): void;
|
|
296
|
+
get(world: World): THREE.Vector3 | null;
|
|
297
|
+
private getClosestVertex;
|
|
298
|
+
private getVertices;
|
|
299
|
+
private getVertex;
|
|
300
|
+
}
|
|
301
|
+
import * as THREE from "three";
|
|
302
|
+
export declare class MaterialsUtils {
|
|
303
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
304
|
+
}
|
|
305
|
+
import { Component, Disposable, Event } from "../Types";
|
|
306
|
+
/**
|
|
307
|
+
* The entry point of the Components library.
|
|
308
|
+
* It can:
|
|
309
|
+
* - Create and access all the components of the library.
|
|
310
|
+
* - Update all the updatable components automatically.
|
|
311
|
+
* - Dispose all the components, preventing memory leaks.
|
|
312
|
+
*/
|
|
313
|
+
export declare class Components implements Disposable {
|
|
314
|
+
static readonly release = "1.4.21";
|
|
315
|
+
/** {@link Disposable.onDisposed} */
|
|
316
|
+
readonly onDisposed: Event<void>;
|
|
317
|
+
/** The list of components created in this app. */
|
|
318
|
+
readonly list: Map<string, Component>;
|
|
319
|
+
/** If disabled, the animation loop will be stopped. */
|
|
320
|
+
enabled: boolean;
|
|
321
|
+
private _clock;
|
|
322
|
+
add(uuid: string, instance: Component): void;
|
|
323
|
+
/**
|
|
324
|
+
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
325
|
+
* doesn't exist, it will instance it automatically.
|
|
326
|
+
*
|
|
327
|
+
* @param Component - The component to get or create.
|
|
328
|
+
*/
|
|
329
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
330
|
+
constructor();
|
|
331
|
+
/**
|
|
332
|
+
* Initializes the library. It should be called at the start of the app after
|
|
333
|
+
* initializing the scene, the renderer and the
|
|
334
|
+
* camera. Additionally, if any component that need a raycaster is
|
|
335
|
+
* used, the {@link raycaster} will need to be initialized.
|
|
336
|
+
*/
|
|
337
|
+
init(): void;
|
|
338
|
+
/**
|
|
339
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
340
|
+
* the library. A memory leak will be created if:
|
|
341
|
+
*
|
|
342
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
343
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
344
|
+
* Angular, Vue, etc).
|
|
345
|
+
*
|
|
346
|
+
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
347
|
+
* referenced by a reference type (object or array).
|
|
348
|
+
*
|
|
349
|
+
* You can learn more about how Three.js handles memory leaks
|
|
350
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
351
|
+
*
|
|
352
|
+
*/
|
|
353
|
+
dispose(): void;
|
|
354
|
+
private update;
|
|
355
|
+
private static setupBVH;
|
|
356
|
+
}
|
|
357
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
358
|
+
import { SimpleRaycaster } from "./src";
|
|
359
|
+
import { Components } from "../Components";
|
|
360
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
361
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
362
|
+
enabled: boolean;
|
|
363
|
+
list: Map<string, SimpleRaycaster>;
|
|
364
|
+
onDisposed: Event<unknown>;
|
|
365
|
+
constructor(components: Components);
|
|
366
|
+
get(world: World): SimpleRaycaster;
|
|
367
|
+
delete(world: World): void;
|
|
368
|
+
dispose(): void;
|
|
369
|
+
}
|
|
370
|
+
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
371
|
+
import { Components } from "../Components";
|
|
372
|
+
import { SimpleWorld } from "./src";
|
|
373
|
+
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
374
|
+
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
375
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
376
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
377
|
+
readonly onDisposed: Event<unknown>;
|
|
378
|
+
list: Map<string, World>;
|
|
379
|
+
enabled: boolean;
|
|
380
|
+
constructor(components: Components);
|
|
381
|
+
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
382
|
+
delete(world: World): void;
|
|
383
|
+
dispose(): void;
|
|
384
|
+
update(delta?: number): void | Promise<void>;
|
|
385
|
+
}
|
|
386
|
+
import * as THREE from "three";
|
|
387
|
+
import { Components } from "../Components";
|
|
388
|
+
import { Component } from "../Types";
|
|
389
|
+
/**
|
|
390
|
+
* A tool to safely remove meshes and geometries from memory to
|
|
391
|
+
* [prevent memory leaks](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
392
|
+
*/
|
|
393
|
+
export declare class Disposer extends Component {
|
|
394
|
+
private _disposedComponents;
|
|
395
|
+
/** {@link Component.enabled} */
|
|
396
|
+
enabled: boolean;
|
|
397
|
+
static readonly uuid: "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe";
|
|
398
|
+
constructor(components: Components);
|
|
399
|
+
/**
|
|
400
|
+
* {@link Component.uuid}.
|
|
401
|
+
* @return the list of UUIDs of deleted components.
|
|
402
|
+
*/
|
|
403
|
+
get(): Set<string>;
|
|
404
|
+
/**
|
|
405
|
+
* Removes a mesh, its geometry and its materials from memory. If you are
|
|
406
|
+
* using any of these in other parts of the application, make sure that you
|
|
407
|
+
* remove them from the mesh before disposing it.
|
|
408
|
+
*
|
|
409
|
+
* @param object - the [object](https://threejs.org/docs/#api/en/core/Object3D)
|
|
410
|
+
* to remove.
|
|
411
|
+
*
|
|
412
|
+
* @param materials - whether to dispose the materials of the mesh.
|
|
413
|
+
*
|
|
414
|
+
* @param recursive - whether to recursively dispose the children of the mesh.
|
|
415
|
+
*/
|
|
416
|
+
destroy(object: THREE.Object3D, materials?: boolean, recursive?: boolean): void;
|
|
417
|
+
/**
|
|
418
|
+
* Disposes a geometry from memory.
|
|
419
|
+
*
|
|
420
|
+
* @param geometry - the
|
|
421
|
+
* [geometry](https://threejs.org/docs/#api/en/core/BufferGeometry)
|
|
422
|
+
* to remove.
|
|
423
|
+
*/
|
|
424
|
+
disposeGeometry(geometry: THREE.BufferGeometry): void;
|
|
425
|
+
private disposeGeometryAndMaterials;
|
|
426
|
+
private disposeChildren;
|
|
427
|
+
private static disposeMaterial;
|
|
428
|
+
}
|
|
429
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
430
|
+
import { GridConfig, SimpleGrid } from "./src";
|
|
431
|
+
export declare class Grids extends Component implements Disposable {
|
|
432
|
+
static readonly uuid: "d1e814d5-b81c-4452-87a2-f039375e0489";
|
|
433
|
+
list: Map<string, SimpleGrid>;
|
|
434
|
+
onDisposed: Event<unknown>;
|
|
435
|
+
config: Required<GridConfig>;
|
|
436
|
+
/** {@link Component.enabled} */
|
|
437
|
+
enabled: boolean;
|
|
438
|
+
create(world: World): void;
|
|
439
|
+
delete(world: World): void;
|
|
440
|
+
dispose(): void;
|
|
441
|
+
}
|
|
442
|
+
import * as THREE from "three";
|
|
443
|
+
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
444
|
+
import { SimplePlane } from "./src";
|
|
445
|
+
import { Components } from "../Components";
|
|
446
|
+
/**
|
|
447
|
+
* A lightweight component to easily create and handle
|
|
448
|
+
* [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
449
|
+
*
|
|
450
|
+
* @param components - the instance of {@link Components} used.
|
|
451
|
+
* @param planeType - the type of plane to be used by the clipper.
|
|
452
|
+
* E.g. {@link SimplePlane}.
|
|
453
|
+
*/
|
|
454
|
+
export declare class Clipper<T extends SimplePlane> extends Component implements Createable, Disposable, Hideable {
|
|
455
|
+
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
456
|
+
/** {@link Createable.onAfterCreate} */
|
|
457
|
+
readonly onAfterCreate: Event<T>;
|
|
458
|
+
/** {@link Createable.onAfterDelete} */
|
|
459
|
+
readonly onAfterDelete: Event<T>;
|
|
460
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
461
|
+
readonly onBeforeDrag: Event<void>;
|
|
462
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
463
|
+
readonly onAfterDrag: Event<void>;
|
|
464
|
+
readonly onBeforeCreate: Event<unknown>;
|
|
465
|
+
readonly onBeforeCancel: Event<unknown>;
|
|
466
|
+
readonly onAfterCancel: Event<unknown>;
|
|
467
|
+
readonly onBeforeDelete: Event<unknown>;
|
|
468
|
+
/** {@link Disposable.onDisposed} */
|
|
469
|
+
readonly onDisposed: Event<string>;
|
|
470
|
+
/**
|
|
471
|
+
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
472
|
+
* (up). This is desirable when clipping a building horizontally and a
|
|
473
|
+
* clipping plane is created in its roof, which might have a slight
|
|
474
|
+
* slope for draining purposes.
|
|
475
|
+
*/
|
|
476
|
+
orthogonalY: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
479
|
+
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
480
|
+
* has to be 'true' for this to apply.
|
|
481
|
+
*/
|
|
482
|
+
toleranceOrthogonalY: number;
|
|
483
|
+
list: T[];
|
|
484
|
+
protected PlaneType: new (...args: any) => SimplePlane | T;
|
|
485
|
+
/** The material used in all the clipping planes. */
|
|
486
|
+
protected _material: THREE.MeshBasicMaterial;
|
|
487
|
+
private _size;
|
|
488
|
+
private _enabled;
|
|
201
489
|
private _visible;
|
|
202
490
|
/** {@link Component.enabled} */
|
|
203
491
|
get enabled(): boolean;
|
|
@@ -254,54 +542,20 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
254
542
|
private _onStartDragging;
|
|
255
543
|
private _onEndDragging;
|
|
256
544
|
}
|
|
257
|
-
import
|
|
258
|
-
import {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
*/
|
|
267
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
268
|
-
/**
|
|
269
|
-
* The current {@link NavigationMode}.
|
|
270
|
-
*/
|
|
271
|
-
mode: NavigationMode;
|
|
272
|
-
readonly projection: ProjectionManager;
|
|
273
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
274
|
-
protected readonly _userInputButtons: any;
|
|
275
|
-
protected readonly _frustumSize = 50;
|
|
276
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
277
|
-
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
545
|
+
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
546
|
+
import { MiniMap } from "./src";
|
|
547
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
548
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
549
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
550
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
551
|
+
readonly onDisposed: Event<unknown>;
|
|
552
|
+
enabled: boolean;
|
|
553
|
+
list: Map<string, MiniMap>;
|
|
278
554
|
constructor(components: Components);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
*
|
|
284
|
-
* @param mode - The {@link NavigationMode} to set.
|
|
285
|
-
*/
|
|
286
|
-
set(mode: NavModeID): void;
|
|
287
|
-
/**
|
|
288
|
-
* Make the camera view fit all the specified meshes.
|
|
289
|
-
*
|
|
290
|
-
* @param meshes the meshes to fit. If it is not defined, it will
|
|
291
|
-
* evaluate {@link Components.meshes}.
|
|
292
|
-
* @param offset the distance to the fit object
|
|
293
|
-
*/
|
|
294
|
-
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
295
|
-
/**
|
|
296
|
-
* Allows or prevents all user input.
|
|
297
|
-
*
|
|
298
|
-
* @param active - whether to enable or disable user inputs.
|
|
299
|
-
*/
|
|
300
|
-
setUserInput(active: boolean): void;
|
|
301
|
-
private disableUserInput;
|
|
302
|
-
private enableUserInput;
|
|
303
|
-
private newOrthoCamera;
|
|
304
|
-
private setOrthoCameraAspect;
|
|
555
|
+
create(world: World): MiniMap;
|
|
556
|
+
delete(id: string): void;
|
|
557
|
+
dispose(): void | Promise<void>;
|
|
558
|
+
update(): void;
|
|
305
559
|
}
|
|
306
560
|
import * as THREE from "three";
|
|
307
561
|
import { Component, Disposable, Event } from "../Types";
|
|
@@ -352,6 +606,55 @@ export declare class Materials extends Component implements Disposable {
|
|
|
352
606
|
*/
|
|
353
607
|
removeMeshes(id: string, meshes: THREE.Mesh[]): void;
|
|
354
608
|
}
|
|
609
|
+
import * as THREE from "three";
|
|
610
|
+
import { Components } from "../../core/Components";
|
|
611
|
+
import { SimpleCamera } from "../../core";
|
|
612
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
613
|
+
/**
|
|
614
|
+
* A flexible camera that uses
|
|
615
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
616
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
617
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
618
|
+
*/
|
|
619
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
620
|
+
/**
|
|
621
|
+
* The current {@link NavigationMode}.
|
|
622
|
+
*/
|
|
623
|
+
mode: NavigationMode;
|
|
624
|
+
readonly projection: ProjectionManager;
|
|
625
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
626
|
+
protected readonly _userInputButtons: any;
|
|
627
|
+
protected readonly _frustumSize = 50;
|
|
628
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
629
|
+
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
630
|
+
constructor(components: Components);
|
|
631
|
+
/** {@link Disposable.dispose} */
|
|
632
|
+
dispose(): void;
|
|
633
|
+
/**
|
|
634
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
635
|
+
*
|
|
636
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
637
|
+
*/
|
|
638
|
+
set(mode: NavModeID): void;
|
|
639
|
+
/**
|
|
640
|
+
* Make the camera view fit all the specified meshes.
|
|
641
|
+
*
|
|
642
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
643
|
+
* evaluate {@link Components.meshes}.
|
|
644
|
+
* @param offset the distance to the fit object
|
|
645
|
+
*/
|
|
646
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
647
|
+
/**
|
|
648
|
+
* Allows or prevents all user input.
|
|
649
|
+
*
|
|
650
|
+
* @param active - whether to enable or disable user inputs.
|
|
651
|
+
*/
|
|
652
|
+
setUserInput(active: boolean): void;
|
|
653
|
+
private disableUserInput;
|
|
654
|
+
private enableUserInput;
|
|
655
|
+
private newOrthoCamera;
|
|
656
|
+
private setOrthoCameraAspect;
|
|
657
|
+
}
|
|
355
658
|
import { Components } from "../Components";
|
|
356
659
|
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
357
660
|
import { Component, Event, Disposable, World } from "../Types";
|
|
@@ -413,55 +716,19 @@ export declare class IfcPropertiesFinder extends Component implements Disposable
|
|
|
413
716
|
indexedModels: IndexedModels;
|
|
414
717
|
private readonly _conditionFunctions;
|
|
415
718
|
private _noHandleAttributes;
|
|
416
|
-
constructor(components: Components);
|
|
417
|
-
private onFragmentsDisposed;
|
|
418
|
-
dispose(): void;
|
|
419
|
-
private indexEntityRelations;
|
|
420
|
-
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
421
|
-
private toFragmentMap;
|
|
422
|
-
private simpleQuery;
|
|
423
|
-
private getMatchingEntities;
|
|
424
|
-
private combineArrays;
|
|
425
|
-
private getCommonElements;
|
|
426
|
-
private arrayIntersection;
|
|
427
|
-
private arrayUnion;
|
|
428
|
-
private getConditionFunctions;
|
|
429
|
-
}
|
|
430
|
-
import * as THREE from "three";
|
|
431
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
432
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
433
|
-
import { Component, Components, Disposable, Event } from "../../core";
|
|
434
|
-
/**
|
|
435
|
-
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
436
|
-
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
437
|
-
*/
|
|
438
|
-
export declare class BoundingBoxes extends Component implements Disposable {
|
|
439
|
-
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
440
|
-
/** {@link Component.enabled} */
|
|
441
|
-
enabled: boolean;
|
|
442
|
-
/** {@link Disposable.onDisposed} */
|
|
443
|
-
readonly onDisposed: Event<unknown>;
|
|
444
|
-
private _absoluteMin;
|
|
445
|
-
private _absoluteMax;
|
|
446
|
-
private _meshes;
|
|
447
|
-
constructor(components: Components);
|
|
448
|
-
static getDimensions(bbox: THREE.Box3): {
|
|
449
|
-
width: number;
|
|
450
|
-
height: number;
|
|
451
|
-
depth: number;
|
|
452
|
-
center: THREE.Vector3;
|
|
453
|
-
};
|
|
454
|
-
static newBound(positive: boolean): THREE.Vector3;
|
|
455
|
-
static getBounds(points: THREE.Vector3[], min?: THREE.Vector3, max?: THREE.Vector3): THREE.Box3;
|
|
456
|
-
/** {@link Disposable.dispose} */
|
|
457
|
-
dispose(): void;
|
|
458
|
-
get(): THREE.Box3;
|
|
459
|
-
getSphere(): THREE.Sphere;
|
|
460
|
-
getMesh(): THREE.Mesh<THREE.BoxGeometry, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
461
|
-
reset(): void;
|
|
462
|
-
add(group: FragmentsGroup): void;
|
|
463
|
-
addMesh(mesh: THREE.InstancedMesh | THREE.Mesh | FRAGS.CurveMesh, itemIDs?: Iterable<number>): void;
|
|
464
|
-
private static getFragmentBounds;
|
|
719
|
+
constructor(components: Components);
|
|
720
|
+
private onFragmentsDisposed;
|
|
721
|
+
dispose(): void;
|
|
722
|
+
private indexEntityRelations;
|
|
723
|
+
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
724
|
+
private toFragmentMap;
|
|
725
|
+
private simpleQuery;
|
|
726
|
+
private getMatchingEntities;
|
|
727
|
+
private combineArrays;
|
|
728
|
+
private getCommonElements;
|
|
729
|
+
private arrayIntersection;
|
|
730
|
+
private arrayUnion;
|
|
731
|
+
private getConditionFunctions;
|
|
465
732
|
}
|
|
466
733
|
import * as WEBIFC from "web-ifc";
|
|
467
734
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
@@ -552,391 +819,167 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
552
819
|
* The resulting object is then serialized into a JSON string.
|
|
553
820
|
*
|
|
554
821
|
* @param relationMap - The map of relations to be serialized. The map keys are expressIDs of entities, and the values are maps where each key is a relation type ID and its value is an array of expressIDs of entities related through that relation type.
|
|
555
|
-
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
556
|
-
*/
|
|
557
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
558
|
-
/**
|
|
559
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
560
|
-
* This method iterates through the relations indexed for the given model,
|
|
561
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
562
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
563
|
-
* The resulting object is then serialized into a JSON string.
|
|
564
|
-
*
|
|
565
|
-
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
566
|
-
* @returns A JSON string representing the serialized relations of the specified model.
|
|
567
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
568
|
-
*/
|
|
569
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
570
|
-
/**
|
|
571
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
572
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
573
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
574
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
575
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
576
|
-
*
|
|
577
|
-
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
578
|
-
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
579
|
-
*/
|
|
580
|
-
serializeAllRelations(): string;
|
|
581
|
-
/**
|
|
582
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
583
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
584
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
585
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
586
|
-
* of express IDs of entities related through that relation type.
|
|
587
|
-
*
|
|
588
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
589
|
-
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
590
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
591
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
592
|
-
*/
|
|
593
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
594
|
-
/**
|
|
595
|
-
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
596
|
-
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
597
|
-
* references that could prevent garbage collection.
|
|
598
|
-
*/
|
|
599
|
-
dispose(): void;
|
|
600
|
-
}
|
|
601
|
-
import * as THREE from "three";
|
|
602
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
603
|
-
center: THREE.Vector3;
|
|
604
|
-
halfSizes: THREE.Vector3;
|
|
605
|
-
rotation: THREE.Matrix3;
|
|
606
|
-
transformation: THREE.Matrix4;
|
|
607
|
-
};
|
|
608
|
-
import * as WEBIFC from "web-ifc";
|
|
609
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
610
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
611
|
-
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
612
|
-
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
613
|
-
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
614
|
-
interface ChangeMap {
|
|
615
|
-
[modelID: string]: Set<number>;
|
|
616
|
-
}
|
|
617
|
-
interface AttributeListener {
|
|
618
|
-
[modelID: string]: {
|
|
619
|
-
[expressID: number]: {
|
|
620
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
621
|
-
};
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
625
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
626
|
-
/** {@link Disposable.onDisposed} */
|
|
627
|
-
readonly onDisposed: Event<string>;
|
|
628
|
-
readonly onRequestFile: Event<unknown>;
|
|
629
|
-
ifcToExport: ArrayBuffer | null;
|
|
630
|
-
readonly onElementToPset: Event<{
|
|
631
|
-
model: FragmentsGroup;
|
|
632
|
-
psetID: number;
|
|
633
|
-
elementID: number;
|
|
634
|
-
}>;
|
|
635
|
-
readonly onPropToPset: Event<{
|
|
636
|
-
model: FragmentsGroup;
|
|
637
|
-
psetID: number;
|
|
638
|
-
propID: number;
|
|
639
|
-
}>;
|
|
640
|
-
readonly onPsetRemoved: Event<{
|
|
641
|
-
model: FragmentsGroup;
|
|
642
|
-
psetID: number;
|
|
643
|
-
}>;
|
|
644
|
-
readonly onDataChanged: Event<{
|
|
645
|
-
model: FragmentsGroup;
|
|
646
|
-
expressID: number;
|
|
647
|
-
}>;
|
|
648
|
-
wasm: {
|
|
649
|
-
path: string;
|
|
650
|
-
absolute: boolean;
|
|
651
|
-
};
|
|
652
|
-
enabled: boolean;
|
|
653
|
-
attributeListeners: AttributeListener;
|
|
654
|
-
selectedModel?: FragmentsGroup;
|
|
655
|
-
private _changeMap;
|
|
656
|
-
constructor(components: Components);
|
|
657
|
-
get(): ChangeMap;
|
|
658
|
-
dispose(): void;
|
|
659
|
-
private increaseMaxID;
|
|
660
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
661
|
-
private newGUID;
|
|
662
|
-
private getOwnerHistory;
|
|
663
|
-
private registerChange;
|
|
664
|
-
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
665
|
-
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
666
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
667
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
668
|
-
}>;
|
|
669
|
-
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
670
|
-
private newSingleProperty;
|
|
671
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
672
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
673
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
674
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
675
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
676
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
677
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
678
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
679
|
-
}
|
|
680
|
-
export {};
|
|
681
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
682
|
-
import { Components, Component } from "../../core";
|
|
683
|
-
export declare class FragmentHider extends Component {
|
|
684
|
-
static readonly uuid: "dd9ccf2d-8a21-4821-b7f6-2949add16a29";
|
|
685
|
-
enabled: boolean;
|
|
686
|
-
constructor(components: Components);
|
|
687
|
-
set(visible: boolean, items?: FRAGS.FragmentIdMap): void;
|
|
688
|
-
isolate(items: FRAGS.FragmentIdMap): void;
|
|
689
|
-
private updateCulledVisibility;
|
|
690
|
-
}
|
|
691
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
692
|
-
export declare class FragmentExploder extends Component implements Disposable {
|
|
693
|
-
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
694
|
-
enabled: boolean;
|
|
695
|
-
height: number;
|
|
696
|
-
groupName: string;
|
|
697
|
-
/** {@link Disposable.onDisposed} */
|
|
698
|
-
readonly onDisposed: Event<string>;
|
|
699
|
-
list: Set<string>;
|
|
700
|
-
constructor(components: Components);
|
|
701
|
-
dispose(): void;
|
|
702
|
-
explode(): void;
|
|
703
|
-
reset(): void;
|
|
704
|
-
update(): void;
|
|
705
|
-
}
|
|
706
|
-
import * as WEBIFC from "web-ifc";
|
|
707
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
708
|
-
import { IfcFragmentSettings } from "./src";
|
|
709
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
710
|
-
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
711
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
712
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
713
|
-
readonly onSetup: Event<void>;
|
|
714
|
-
/** {@link Disposable.onDisposed} */
|
|
715
|
-
readonly onDisposed: Event<string>;
|
|
716
|
-
settings: IfcFragmentSettings;
|
|
717
|
-
enabled: boolean;
|
|
718
|
-
webIfc: WEBIFC.IfcAPI;
|
|
719
|
-
private _material;
|
|
720
|
-
private _spatialTree;
|
|
721
|
-
private _metaData;
|
|
722
|
-
private _fragmentInstances;
|
|
723
|
-
private _civil;
|
|
724
|
-
private _propertyExporter;
|
|
725
|
-
private _visitedFragments;
|
|
726
|
-
private _materialT;
|
|
727
|
-
constructor(components: Components);
|
|
728
|
-
dispose(): void;
|
|
729
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
730
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
731
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
732
|
-
private getAllGeometries;
|
|
733
|
-
cleanUp(): void;
|
|
734
|
-
private getMesh;
|
|
735
|
-
private getGeometry;
|
|
736
|
-
private autoSetWasm;
|
|
737
|
-
}
|
|
738
|
-
import * as THREE from "three";
|
|
739
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
740
|
-
import { Disposable, Component, Event, Components } from "../../core";
|
|
741
|
-
export interface Classification {
|
|
742
|
-
[system: string]: {
|
|
743
|
-
[className: string]: FRAGS.FragmentIdMap;
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
export declare class FragmentClassifier extends Component implements Disposable {
|
|
747
|
-
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
748
|
-
/** {@link Component.enabled} */
|
|
749
|
-
enabled: boolean;
|
|
750
|
-
list: Classification;
|
|
751
|
-
/** {@link Disposable.onDisposed} */
|
|
752
|
-
readonly onDisposed: Event<unknown>;
|
|
753
|
-
constructor(components: Components);
|
|
754
|
-
private onFragmentsDisposed;
|
|
755
|
-
dispose(): void;
|
|
756
|
-
remove(guid: string): void;
|
|
757
|
-
find(filter?: {
|
|
758
|
-
[name: string]: string[];
|
|
759
|
-
}): FRAGS.FragmentIdMap;
|
|
760
|
-
byModel(modelID: string, group: FRAGS.FragmentsGroup): void;
|
|
761
|
-
byPredefinedType(group: FRAGS.FragmentsGroup): Promise<void>;
|
|
762
|
-
byEntity(group: FRAGS.FragmentsGroup): void;
|
|
763
|
-
byStorey(group: FRAGS.FragmentsGroup): void;
|
|
764
|
-
byIfcRel(group: FRAGS.FragmentsGroup, ifcRel: number, systemName: string): Promise<void>;
|
|
765
|
-
setColor(items: FRAGS.FragmentIdMap, color: THREE.Color, override?: boolean): void;
|
|
766
|
-
resetColor(items: FRAGS.FragmentIdMap): void;
|
|
767
|
-
private saveItem;
|
|
768
|
-
}
|
|
769
|
-
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
770
|
-
import * as THREE from "three";
|
|
771
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
772
|
-
/**
|
|
773
|
-
* Object that can efficiently load binary files that contain
|
|
774
|
-
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
775
|
-
*/
|
|
776
|
-
export declare class FragmentManager extends Component implements Disposable {
|
|
777
|
-
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
778
|
-
/** {@link Disposable.onDisposed} */
|
|
779
|
-
readonly onDisposed: Event<unknown>;
|
|
780
|
-
readonly onFragmentsLoaded: Event<FragmentsGroup>;
|
|
781
|
-
readonly onFragmentsDisposed: Event<{
|
|
782
|
-
groupID: string;
|
|
783
|
-
fragmentIDs: string[];
|
|
784
|
-
}>;
|
|
785
|
-
/** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
|
|
786
|
-
readonly list: Map<string, Fragment>;
|
|
787
|
-
readonly groups: Map<string, FragmentsGroup>;
|
|
788
|
-
/** {@link Component.enabled} */
|
|
789
|
-
enabled: boolean;
|
|
790
|
-
baseCoordinationModel: string;
|
|
791
|
-
private _loader;
|
|
792
|
-
/** The list of meshes of the created fragments. */
|
|
793
|
-
get meshes(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[];
|
|
794
|
-
constructor(components: Components);
|
|
795
|
-
/** {@link Disposable.dispose} */
|
|
796
|
-
dispose(): void;
|
|
797
|
-
disposeGroup(group: FragmentsGroup): void;
|
|
822
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
823
|
+
*/
|
|
824
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
798
825
|
/**
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
826
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
827
|
+
* This method iterates through the relations indexed for the given model,
|
|
828
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
829
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
830
|
+
* The resulting object is then serialized into a JSON string.
|
|
831
|
+
*
|
|
832
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
833
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
834
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
803
835
|
*/
|
|
804
|
-
|
|
836
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
805
837
|
/**
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
838
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
839
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
840
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
841
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
842
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
843
|
+
*
|
|
844
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
845
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
809
846
|
*/
|
|
810
|
-
|
|
811
|
-
|
|
847
|
+
serializeAllRelations(): string;
|
|
848
|
+
/**
|
|
849
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
850
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
851
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
852
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
853
|
+
* of express IDs of entities related through that relation type.
|
|
854
|
+
*
|
|
855
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
856
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
857
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
858
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
859
|
+
*/
|
|
860
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
861
|
+
/**
|
|
862
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
863
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
864
|
+
* references that could prevent garbage collection.
|
|
865
|
+
*/
|
|
866
|
+
dispose(): void;
|
|
812
867
|
}
|
|
813
868
|
import * as WEBIFC from "web-ifc";
|
|
814
|
-
import {
|
|
815
|
-
import {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
[id: number]: any;
|
|
822
|
-
};
|
|
823
|
-
}>;
|
|
824
|
-
onProgress: AsyncEvent<number>;
|
|
825
|
-
onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
826
|
-
/** {@link Disposable.onDisposed} */
|
|
827
|
-
readonly onDisposed: Event<string>;
|
|
828
|
-
enabled: boolean;
|
|
829
|
-
settings: PropertiesStreamingSettings;
|
|
830
|
-
webIfc: WEBIFC.IfcAPI;
|
|
831
|
-
dispose(): Promise<void>;
|
|
832
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
833
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
834
|
-
private readIfcFile;
|
|
835
|
-
private streamIfcFile;
|
|
836
|
-
private streamAllProperties;
|
|
837
|
-
private cleanUp;
|
|
838
|
-
}
|
|
839
|
-
import * as THREE from "three";
|
|
840
|
-
export interface MeasureEdge {
|
|
841
|
-
distance: number;
|
|
842
|
-
points: THREE.Vector3[];
|
|
869
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
870
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
871
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
872
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
873
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
874
|
+
interface ChangeMap {
|
|
875
|
+
[modelID: string]: Set<number>;
|
|
843
876
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
850
|
-
private static getFaceData;
|
|
851
|
-
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
852
|
-
p1: THREE.Vector3;
|
|
853
|
-
p2: THREE.Vector3;
|
|
854
|
-
p3: THREE.Vector3;
|
|
855
|
-
faceNormal: THREE.Vector3;
|
|
877
|
+
interface AttributeListener {
|
|
878
|
+
[modelID: string]: {
|
|
879
|
+
[expressID: number]: {
|
|
880
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
881
|
+
};
|
|
856
882
|
};
|
|
857
|
-
private static round;
|
|
858
883
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
862
|
-
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
863
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
864
|
-
onGeometryStreamed: Event<{
|
|
865
|
-
buffer: Uint8Array;
|
|
866
|
-
data: StreamedGeometries;
|
|
867
|
-
}>;
|
|
868
|
-
onAssetStreamed: Event<StreamedAsset[]>;
|
|
869
|
-
onProgress: Event<number>;
|
|
870
|
-
onIfcLoaded: Event<Uint8Array>;
|
|
884
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
885
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
871
886
|
/** {@link Disposable.onDisposed} */
|
|
872
|
-
readonly onDisposed: Event<
|
|
873
|
-
|
|
887
|
+
readonly onDisposed: Event<string>;
|
|
888
|
+
readonly onRequestFile: Event<unknown>;
|
|
889
|
+
ifcToExport: ArrayBuffer | null;
|
|
890
|
+
readonly onElementToPset: Event<{
|
|
891
|
+
model: FragmentsGroup;
|
|
892
|
+
psetID: number;
|
|
893
|
+
elementID: number;
|
|
894
|
+
}>;
|
|
895
|
+
readonly onPropToPset: Event<{
|
|
896
|
+
model: FragmentsGroup;
|
|
897
|
+
psetID: number;
|
|
898
|
+
propID: number;
|
|
899
|
+
}>;
|
|
900
|
+
readonly onPsetRemoved: Event<{
|
|
901
|
+
model: FragmentsGroup;
|
|
902
|
+
psetID: number;
|
|
903
|
+
}>;
|
|
904
|
+
readonly onDataChanged: Event<{
|
|
905
|
+
model: FragmentsGroup;
|
|
906
|
+
expressID: number;
|
|
907
|
+
}>;
|
|
908
|
+
wasm: {
|
|
909
|
+
path: string;
|
|
910
|
+
absolute: boolean;
|
|
911
|
+
};
|
|
874
912
|
enabled: boolean;
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
private
|
|
878
|
-
private _visitedGeometries;
|
|
879
|
-
private _streamSerializer;
|
|
880
|
-
private _geometries;
|
|
881
|
-
private _geometryCount;
|
|
882
|
-
private _civil;
|
|
883
|
-
private _groupSerializer;
|
|
884
|
-
private _assets;
|
|
885
|
-
private _meshesWithHoles;
|
|
913
|
+
attributeListeners: AttributeListener;
|
|
914
|
+
selectedModel?: FragmentsGroup;
|
|
915
|
+
private _changeMap;
|
|
886
916
|
constructor(components: Components);
|
|
917
|
+
get(): ChangeMap;
|
|
887
918
|
dispose(): void;
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
private
|
|
891
|
-
private
|
|
892
|
-
private
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
919
|
+
private increaseMaxID;
|
|
920
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
921
|
+
private newGUID;
|
|
922
|
+
private getOwnerHistory;
|
|
923
|
+
private registerChange;
|
|
924
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
925
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
926
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
927
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
928
|
+
}>;
|
|
929
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
930
|
+
private newSingleProperty;
|
|
931
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
932
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
933
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
934
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
935
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
936
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
937
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
938
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
903
939
|
}
|
|
904
|
-
export
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
940
|
+
export {};
|
|
941
|
+
import * as WEBIFC from "web-ifc";
|
|
942
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
943
|
+
export declare class SpatialStructure {
|
|
944
|
+
itemsByFloor: IfcItemsCategories;
|
|
945
|
+
private _units;
|
|
946
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
947
|
+
cleanUp(): void;
|
|
909
948
|
}
|
|
949
|
+
export declare const GeometryTypes: Set<number>;
|
|
910
950
|
import * as THREE from "three";
|
|
911
|
-
import {
|
|
912
|
-
export
|
|
913
|
-
showOnlyVertex: boolean;
|
|
914
|
-
snapDistance: number;
|
|
915
|
-
previewElement: HTMLElement;
|
|
916
|
-
}
|
|
917
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
918
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
919
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
920
|
-
components: Components;
|
|
921
|
-
private _pickedPoint;
|
|
922
|
-
private _config;
|
|
923
|
-
private _enabled;
|
|
924
|
-
private _workingPlane;
|
|
951
|
+
import { Event, Resizeable, Updateable, Disposable, World } from "../../../core";
|
|
952
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
925
953
|
/** {@link Disposable.onDisposed} */
|
|
926
954
|
readonly onDisposed: Event<unknown>;
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
955
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
956
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
957
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
958
|
+
frontOffset: number;
|
|
959
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
960
|
+
backgroundColor: THREE.Color;
|
|
961
|
+
renderer: THREE.WebGLRenderer;
|
|
962
|
+
enabled: boolean;
|
|
963
|
+
world: World;
|
|
964
|
+
private _lockRotation;
|
|
965
|
+
private _camera;
|
|
966
|
+
private _plane;
|
|
967
|
+
private _size;
|
|
968
|
+
private _tempVector1;
|
|
969
|
+
private _tempVector2;
|
|
970
|
+
private _tempTarget;
|
|
971
|
+
private readonly down;
|
|
972
|
+
get lockRotation(): boolean;
|
|
973
|
+
set lockRotation(active: boolean);
|
|
974
|
+
get zoom(): number;
|
|
975
|
+
set zoom(value: number);
|
|
976
|
+
constructor(world: World);
|
|
935
977
|
dispose(): void;
|
|
936
|
-
get(
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
978
|
+
get(): THREE.OrthographicCamera;
|
|
979
|
+
update(): void;
|
|
980
|
+
getSize(): THREE.Vector2;
|
|
981
|
+
resize(size?: THREE.Vector2): void;
|
|
982
|
+
private updatePlanes;
|
|
940
983
|
}
|
|
941
984
|
import * as WEBIFC from "web-ifc";
|
|
942
985
|
export interface IfcItemsCategories {
|
|
@@ -945,6 +988,13 @@ export interface IfcItemsCategories {
|
|
|
945
988
|
export declare class IfcCategories {
|
|
946
989
|
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
947
990
|
}
|
|
991
|
+
export declare const relToAttributesMap: Map<number, {
|
|
992
|
+
forRelating?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
993
|
+
forRelated?: "IsDecomposedBy" | "Decomposes" | "AssociatedTo" | "HasAssociations" | "ClassificationForObjects" | "IsGroupedBy" | "HasAssignments" | "IsDefinedBy" | "DefinesOcurrence" | "IsTypedBy" | "Types" | "Defines" | "ContainedInStructure" | "ContainsElements" | undefined;
|
|
994
|
+
}>;
|
|
995
|
+
export declare const getRelationMap: (properties: Record<string, Record<string, any>>, relationType: number, onElementsFound?: ((relatingID: number, relatedIDs: number[]) => void) | undefined) => {
|
|
996
|
+
[relatingID: number]: number[];
|
|
997
|
+
};
|
|
948
998
|
import * as FRAGS from "@thatopen/fragments";
|
|
949
999
|
export declare class IfcPropertiesUtils {
|
|
950
1000
|
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
@@ -970,83 +1020,181 @@ export declare class IfcPropertiesUtils {
|
|
|
970
1020
|
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
971
1021
|
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
972
1022
|
}
|
|
973
|
-
export declare const IfcCategoryMap: {
|
|
974
|
-
[key: number]: string;
|
|
975
|
-
};
|
|
976
1023
|
export declare const IfcElements: {
|
|
977
1024
|
[key: number]: string;
|
|
978
1025
|
};
|
|
979
1026
|
import * as THREE from "three";
|
|
980
|
-
import {
|
|
981
|
-
|
|
1027
|
+
import { Disposable, Event } from "../../Types";
|
|
1028
|
+
/**
|
|
1029
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1030
|
+
* to work with tools like the
|
|
1031
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1032
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1033
|
+
*/
|
|
1034
|
+
export declare class Mouse implements Disposable {
|
|
1035
|
+
dom: HTMLCanvasElement;
|
|
1036
|
+
private _event?;
|
|
1037
|
+
private _position;
|
|
982
1038
|
/** {@link Disposable.onDisposed} */
|
|
983
1039
|
readonly onDisposed: Event<unknown>;
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
renderer: THREE.WebGLRenderer;
|
|
991
|
-
enabled: boolean;
|
|
992
|
-
world: World;
|
|
993
|
-
private _lockRotation;
|
|
994
|
-
private _camera;
|
|
995
|
-
private _plane;
|
|
996
|
-
private _size;
|
|
997
|
-
private _tempVector1;
|
|
998
|
-
private _tempVector2;
|
|
999
|
-
private _tempTarget;
|
|
1000
|
-
private readonly down;
|
|
1001
|
-
get lockRotation(): boolean;
|
|
1002
|
-
set lockRotation(active: boolean);
|
|
1003
|
-
get zoom(): number;
|
|
1004
|
-
set zoom(value: number);
|
|
1005
|
-
constructor(world: World);
|
|
1040
|
+
constructor(dom: HTMLCanvasElement);
|
|
1041
|
+
/**
|
|
1042
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1043
|
+
*/
|
|
1044
|
+
get position(): THREE.Vector2;
|
|
1045
|
+
/** {@link Disposable.dispose} */
|
|
1006
1046
|
dispose(): void;
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
private updatePlanes;
|
|
1047
|
+
private getPositionY;
|
|
1048
|
+
private getPositionX;
|
|
1049
|
+
private updateMouseInfo;
|
|
1050
|
+
private setupEvents;
|
|
1012
1051
|
}
|
|
1013
|
-
export declare const
|
|
1014
|
-
|
|
1015
|
-
[relatingID: number]: number[];
|
|
1052
|
+
export declare const IfcCategoryMap: {
|
|
1053
|
+
[key: number]: string;
|
|
1016
1054
|
};
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1055
|
+
import * as WEBIFC from "web-ifc";
|
|
1056
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
1057
|
+
export declare class IfcFragmentSettings {
|
|
1058
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
1059
|
+
includeProperties: boolean;
|
|
1060
|
+
/**
|
|
1061
|
+
* Generate the geometry for categories that are not included by default,
|
|
1062
|
+
* like IFCSPACE.
|
|
1063
|
+
*/
|
|
1064
|
+
optionalCategories: number[];
|
|
1065
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
1066
|
+
coordinate: boolean;
|
|
1067
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1068
|
+
wasm: {
|
|
1069
|
+
path: string;
|
|
1070
|
+
absolute: boolean;
|
|
1071
|
+
logLevel?: WEBIFC.LogLevel;
|
|
1033
1072
|
};
|
|
1073
|
+
/** List of categories that won't be converted to fragments. */
|
|
1074
|
+
excludedCategories: Set<number>;
|
|
1075
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
1076
|
+
saveLocations: boolean;
|
|
1077
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1078
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1079
|
+
autoSetWasm: boolean;
|
|
1080
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1081
|
+
}
|
|
1082
|
+
import * as THREE from "three";
|
|
1083
|
+
import * as WEBIFC from "web-ifc";
|
|
1084
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1085
|
+
export declare class CivilReader {
|
|
1086
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1087
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1088
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1089
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1090
|
+
} | undefined;
|
|
1091
|
+
get(civilItems: any): {
|
|
1092
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1093
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1094
|
+
} | undefined;
|
|
1095
|
+
private getCurves;
|
|
1096
|
+
}
|
|
1097
|
+
import * as WEBIFC from "web-ifc";
|
|
1098
|
+
export declare class IfcMetadataReader {
|
|
1099
|
+
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1100
|
+
}
|
|
1101
|
+
import * as WEBIFC from "web-ifc";
|
|
1102
|
+
import * as THREE from "three";
|
|
1103
|
+
export declare class Units {
|
|
1104
|
+
factor: number;
|
|
1105
|
+
complement: number;
|
|
1106
|
+
apply(matrix: THREE.Matrix4): void;
|
|
1107
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1108
|
+
private getLengthUnits;
|
|
1109
|
+
private getScaleMatrix;
|
|
1034
1110
|
}
|
|
1111
|
+
import * as THREE from "three";
|
|
1112
|
+
import { Components } from "../../Components";
|
|
1113
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1114
|
+
import { Mouse } from "./mouse";
|
|
1035
1115
|
/**
|
|
1036
|
-
* A
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1116
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1117
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1118
|
+
* events.
|
|
1039
1119
|
*/
|
|
1040
|
-
export declare class
|
|
1041
|
-
/** {@link
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
/** {@link
|
|
1045
|
-
readonly
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1120
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1121
|
+
/** {@link Component.enabled} */
|
|
1122
|
+
enabled: boolean;
|
|
1123
|
+
components: Components;
|
|
1124
|
+
/** {@link Disposable.onDisposed} */
|
|
1125
|
+
readonly onDisposed: Event<unknown>;
|
|
1126
|
+
/** The position of the mouse in the screen. */
|
|
1127
|
+
readonly mouse: Mouse;
|
|
1128
|
+
readonly three: THREE.Raycaster;
|
|
1129
|
+
world: World;
|
|
1130
|
+
constructor(components: Components, world: World);
|
|
1131
|
+
/** {@link Disposable.dispose} */
|
|
1132
|
+
dispose(): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1135
|
+
* the first item found. This also takes into account the clipping planes
|
|
1136
|
+
* used by the renderer.
|
|
1137
|
+
*
|
|
1138
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1139
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1140
|
+
* {@link Components.meshes}.
|
|
1141
|
+
*/
|
|
1142
|
+
castRay(items?: THREE.Mesh[]): THREE.Intersection | null;
|
|
1143
|
+
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;
|
|
1144
|
+
private intersect;
|
|
1145
|
+
private filterClippingPlanes;
|
|
1146
|
+
}
|
|
1147
|
+
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1148
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1149
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1150
|
+
minGeometrySize: number;
|
|
1151
|
+
minAssetsSize: number;
|
|
1152
|
+
}
|
|
1153
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1154
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1155
|
+
propertiesSize: number;
|
|
1156
|
+
}
|
|
1157
|
+
export interface StreamedGeometries {
|
|
1158
|
+
[id: number]: {
|
|
1159
|
+
boundingBox: Float32Array;
|
|
1160
|
+
hasHoles: boolean;
|
|
1161
|
+
geometryFile?: string;
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
export interface StreamedAsset {
|
|
1165
|
+
id: number;
|
|
1166
|
+
geometries: {
|
|
1167
|
+
geometryID: number;
|
|
1168
|
+
transformation: number[];
|
|
1169
|
+
color: number[];
|
|
1170
|
+
}[];
|
|
1171
|
+
}
|
|
1172
|
+
import * as WEBIFC from "web-ifc";
|
|
1173
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1174
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1175
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1176
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1177
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1178
|
+
type: number;
|
|
1179
|
+
data: {
|
|
1180
|
+
[id: number]: any;
|
|
1181
|
+
};
|
|
1182
|
+
}>;
|
|
1183
|
+
onProgress: AsyncEvent<number>;
|
|
1184
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1185
|
+
/** {@link Disposable.onDisposed} */
|
|
1186
|
+
readonly onDisposed: Event<string>;
|
|
1187
|
+
enabled: boolean;
|
|
1188
|
+
settings: PropertiesStreamingSettings;
|
|
1189
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1190
|
+
dispose(): Promise<void>;
|
|
1191
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1192
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1193
|
+
private readIfcFile;
|
|
1194
|
+
private streamIfcFile;
|
|
1195
|
+
private streamAllProperties;
|
|
1196
|
+
private getIndices;
|
|
1197
|
+
private cleanUp;
|
|
1050
1198
|
}
|
|
1051
1199
|
import * as THREE from "three";
|
|
1052
1200
|
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
@@ -1067,36 +1215,43 @@ export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends Base
|
|
|
1067
1215
|
get scene(): T;
|
|
1068
1216
|
set scene(scene: T);
|
|
1069
1217
|
get camera(): U;
|
|
1070
|
-
set camera(camera: U);
|
|
1071
|
-
get renderer(): S | null;
|
|
1072
|
-
set renderer(renderer: S | null);
|
|
1073
|
-
constructor(components: Components);
|
|
1074
|
-
update(delta?: number): void;
|
|
1075
|
-
dispose(disposeResources?: boolean): void;
|
|
1076
|
-
}
|
|
1077
|
-
import * as WEBIFC from "web-ifc";
|
|
1078
|
-
import { IfcItemsCategories } from "../../../ifc";
|
|
1079
|
-
export declare class SpatialStructure {
|
|
1080
|
-
itemsByFloor: IfcItemsCategories;
|
|
1081
|
-
private _units;
|
|
1082
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1083
|
-
cleanUp(): void;
|
|
1218
|
+
set camera(camera: U);
|
|
1219
|
+
get renderer(): S | null;
|
|
1220
|
+
set renderer(renderer: S | null);
|
|
1221
|
+
constructor(components: Components);
|
|
1222
|
+
update(delta?: number): void;
|
|
1223
|
+
dispose(disposeResources?: boolean): void;
|
|
1084
1224
|
}
|
|
1085
|
-
import
|
|
1225
|
+
import * as THREE from "three";
|
|
1226
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1227
|
+
import { Components } from "../../Components";
|
|
1086
1228
|
/**
|
|
1087
|
-
* A
|
|
1088
|
-
*
|
|
1229
|
+
* A basic renderer capable of rendering
|
|
1230
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1089
1231
|
*/
|
|
1090
|
-
export declare class
|
|
1091
|
-
camera: any;
|
|
1092
|
-
/** {@link NavigationMode.enabled} */
|
|
1232
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1093
1233
|
enabled: boolean;
|
|
1094
|
-
/**
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1234
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1235
|
+
container: HTMLElement;
|
|
1236
|
+
three: THREE.WebGLRenderer;
|
|
1237
|
+
protected _canvas: HTMLCanvasElement;
|
|
1238
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1239
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1240
|
+
protected onContainerUpdated: Event<HTMLElement>;
|
|
1241
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1242
|
+
/** {@link Updateable.update} */
|
|
1243
|
+
update(): void;
|
|
1244
|
+
/** {@link Disposable.dispose} */
|
|
1245
|
+
dispose(): void;
|
|
1246
|
+
/** {@link Resizeable.getSize}. */
|
|
1247
|
+
getSize(): THREE.Vector2;
|
|
1248
|
+
/** {@link Resizeable.resize} */
|
|
1249
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1250
|
+
setupEvents(active: boolean): void;
|
|
1251
|
+
private resizeEvent;
|
|
1252
|
+
private setupRenderer;
|
|
1253
|
+
private onContextLost;
|
|
1254
|
+
private onContextBack;
|
|
1100
1255
|
}
|
|
1101
1256
|
import * as THREE from "three";
|
|
1102
1257
|
import CameraControls from "camera-controls";
|
|
@@ -1144,198 +1299,144 @@ export declare class SimpleCamera extends BaseCamera implements Updateable, Disp
|
|
|
1144
1299
|
private setupEvents;
|
|
1145
1300
|
private static getSubsetOfThree;
|
|
1146
1301
|
}
|
|
1147
|
-
import { NavigationMode } from "./types";
|
|
1148
|
-
/**
|
|
1149
|
-
* A {@link NavigationMode} that allows first person navigation,
|
|
1150
|
-
* simulating FPS video games.
|
|
1151
|
-
*/
|
|
1152
|
-
export declare class FirstPersonMode implements NavigationMode {
|
|
1153
|
-
private camera;
|
|
1154
|
-
/** {@link NavigationMode.enabled} */
|
|
1155
|
-
enabled: boolean;
|
|
1156
|
-
/** {@link NavigationMode.id} */
|
|
1157
|
-
readonly id = "FirstPerson";
|
|
1158
|
-
constructor(camera: any);
|
|
1159
|
-
/** {@link NavigationMode.set} */
|
|
1160
|
-
set(active: boolean): void;
|
|
1161
|
-
private setupFirstPersonCamera;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* The projection system of the camera.
|
|
1165
|
-
*/
|
|
1166
|
-
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1167
|
-
/**
|
|
1168
|
-
* The extensible list of supported navigation modes.
|
|
1169
|
-
*/
|
|
1170
|
-
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1171
|
-
/**
|
|
1172
|
-
* An object that determines the behavior of the camera controls
|
|
1173
|
-
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1174
|
-
*/
|
|
1175
|
-
export interface NavigationMode {
|
|
1176
|
-
/** The unique ID of this navigation mode. */
|
|
1177
|
-
id: NavModeID;
|
|
1178
|
-
/**
|
|
1179
|
-
* Enable or disable this navigation mode.
|
|
1180
|
-
* When a new navigation mode is enabled, the previous navigation mode
|
|
1181
|
-
* must be disabled.
|
|
1182
|
-
*
|
|
1183
|
-
* @param active - whether to enable or disable this mode.
|
|
1184
|
-
* @param options - any additional data required to enable or disable it.
|
|
1185
|
-
* */
|
|
1186
|
-
set: (active: boolean, options?: any) => void;
|
|
1187
|
-
/** Whether this navigation mode is active or not. */
|
|
1188
|
-
enabled: boolean;
|
|
1189
|
-
}
|
|
1190
1302
|
import * as THREE from "three";
|
|
1191
|
-
import {
|
|
1303
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1192
1304
|
import { Components } from "../../Components";
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1204
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
1205
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1206
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1207
|
-
/** {@link Updateable.update} */
|
|
1208
|
-
update(): void;
|
|
1209
|
-
/** {@link Disposable.dispose} */
|
|
1210
|
-
dispose(): void;
|
|
1211
|
-
/** {@link Resizeable.getSize}. */
|
|
1212
|
-
getSize(): THREE.Vector2;
|
|
1213
|
-
/** {@link Resizeable.resize} */
|
|
1214
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1215
|
-
setupEvents(active: boolean): void;
|
|
1216
|
-
private resizeEvent;
|
|
1217
|
-
private setupRenderer;
|
|
1218
|
-
private onContextLost;
|
|
1219
|
-
private onContextBack;
|
|
1220
|
-
}
|
|
1221
|
-
import * as THREE from "three";
|
|
1222
|
-
import { CameraProjection } from "./types";
|
|
1223
|
-
import { Event } from "../../../core";
|
|
1224
|
-
import { OrthoPerspectiveCamera } from "../index";
|
|
1225
|
-
/**
|
|
1226
|
-
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1227
|
-
*/
|
|
1228
|
-
export declare class ProjectionManager {
|
|
1229
|
-
/**
|
|
1230
|
-
* Event that fires when the {@link CameraProjection} changes.
|
|
1231
|
-
*/
|
|
1232
|
-
readonly onChanged: Event<THREE.Camera>;
|
|
1233
|
-
current: CameraProjection;
|
|
1234
|
-
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1235
|
-
private _component;
|
|
1236
|
-
private _previousDistance;
|
|
1237
|
-
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1238
|
-
matchOrthoDistanceEnabled: boolean;
|
|
1239
|
-
constructor(camera: OrthoPerspectiveCamera);
|
|
1240
|
-
/**
|
|
1241
|
-
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1242
|
-
*
|
|
1243
|
-
* @param projection - the new projection to set. If it is the current projection,
|
|
1244
|
-
* it will have no effect.
|
|
1245
|
-
*/
|
|
1246
|
-
set(projection: CameraProjection): Promise<void>;
|
|
1247
|
-
/**
|
|
1248
|
-
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1249
|
-
* and vice versa.
|
|
1250
|
-
*/
|
|
1251
|
-
toggle(): Promise<void>;
|
|
1252
|
-
private setOrthoCamera;
|
|
1253
|
-
private getDims;
|
|
1254
|
-
private setupOrthoCamera;
|
|
1255
|
-
private getDistance;
|
|
1256
|
-
private setPerspectiveCamera;
|
|
1305
|
+
export interface SimpleSceneConfig {
|
|
1306
|
+
directionalLight: {
|
|
1307
|
+
color: THREE.Color;
|
|
1308
|
+
intensity: number;
|
|
1309
|
+
position: THREE.Vector3;
|
|
1310
|
+
};
|
|
1311
|
+
ambientLight: {
|
|
1312
|
+
color: THREE.Color;
|
|
1313
|
+
intensity: number;
|
|
1314
|
+
};
|
|
1257
1315
|
}
|
|
1258
|
-
import { NavigationMode } from "./types";
|
|
1259
1316
|
/**
|
|
1260
|
-
* A
|
|
1261
|
-
*
|
|
1317
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1318
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1319
|
+
* @noInheritDoc
|
|
1262
1320
|
*/
|
|
1263
|
-
export declare class
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
/** {@link
|
|
1268
|
-
readonly
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
private readonly defaultPolarSpeed;
|
|
1274
|
-
constructor(camera: any);
|
|
1275
|
-
/** {@link NavigationMode.set} */
|
|
1276
|
-
set(active: boolean): void;
|
|
1321
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1322
|
+
/** {@link Configurable.isSetup} */
|
|
1323
|
+
isSetup: boolean;
|
|
1324
|
+
three: THREE.Scene;
|
|
1325
|
+
/** {@link Configurable.onSetup} */
|
|
1326
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1327
|
+
config: Required<SimpleSceneConfig>;
|
|
1328
|
+
constructor(components: Components);
|
|
1329
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1330
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1277
1331
|
}
|
|
1278
1332
|
import * as THREE from "three";
|
|
1279
|
-
import { Disposable, Event } from "../../Types";
|
|
1333
|
+
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1334
|
+
import { Components } from "../../Components";
|
|
1280
1335
|
/**
|
|
1281
|
-
*
|
|
1282
|
-
* to work with tools like the
|
|
1283
|
-
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1284
|
-
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1336
|
+
* Each of the planes created by {@link SimpleClipper}.
|
|
1285
1337
|
*/
|
|
1286
|
-
export declare class
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1338
|
+
export declare class SimplePlane implements Disposable, Hideable {
|
|
1339
|
+
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1340
|
+
readonly onDraggingStarted: Event<unknown>;
|
|
1341
|
+
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1342
|
+
readonly onDraggingEnded: Event<unknown>;
|
|
1290
1343
|
/** {@link Disposable.onDisposed} */
|
|
1291
1344
|
readonly onDisposed: Event<unknown>;
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
private
|
|
1301
|
-
private
|
|
1302
|
-
private
|
|
1345
|
+
readonly normal: THREE.Vector3;
|
|
1346
|
+
readonly origin: THREE.Vector3;
|
|
1347
|
+
readonly three: THREE.Plane;
|
|
1348
|
+
protected readonly _helper: THREE.Object3D;
|
|
1349
|
+
protected _visible: boolean;
|
|
1350
|
+
protected _enabled: boolean;
|
|
1351
|
+
components: Components;
|
|
1352
|
+
world: World;
|
|
1353
|
+
private _controlsActive;
|
|
1354
|
+
private readonly _arrowBoundBox;
|
|
1355
|
+
private readonly _planeMesh;
|
|
1356
|
+
private readonly _controls;
|
|
1357
|
+
private readonly _hiddenMaterial;
|
|
1358
|
+
get enabled(): boolean;
|
|
1359
|
+
/** {@link Component.enabled} */
|
|
1360
|
+
set enabled(state: boolean);
|
|
1361
|
+
/** {@link Hideable.visible } */
|
|
1362
|
+
get visible(): boolean;
|
|
1363
|
+
/** {@link Hideable.visible } */
|
|
1364
|
+
set visible(state: boolean);
|
|
1365
|
+
/** The meshes used for raycasting */
|
|
1366
|
+
get meshes(): THREE.Mesh[];
|
|
1367
|
+
/** The material of the clipping plane representation. */
|
|
1368
|
+
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1369
|
+
/** The material of the clipping plane representation. */
|
|
1370
|
+
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1371
|
+
/** The size of the clipping plane representation. */
|
|
1372
|
+
get size(): number;
|
|
1373
|
+
/** Sets the size of the clipping plane representation. */
|
|
1374
|
+
set size(size: number);
|
|
1375
|
+
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1376
|
+
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1377
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1378
|
+
/** {@link Updateable.update} */
|
|
1379
|
+
update: () => Promise<void>;
|
|
1380
|
+
/** {@link Disposable.dispose} */
|
|
1381
|
+
dispose(): void;
|
|
1382
|
+
private reset;
|
|
1383
|
+
protected toggleControls(state: boolean): void;
|
|
1384
|
+
private newTransformControls;
|
|
1385
|
+
private initializeControls;
|
|
1386
|
+
private createArrowBoundingBox;
|
|
1387
|
+
private changeDrag;
|
|
1388
|
+
private notifyDraggingChanged;
|
|
1389
|
+
private preventCameraMovement;
|
|
1390
|
+
private newHelper;
|
|
1391
|
+
private static newPlaneMesh;
|
|
1303
1392
|
}
|
|
1393
|
+
/// <reference types="node" />
|
|
1304
1394
|
import * as THREE from "three";
|
|
1395
|
+
import { Hideable, Event, World } from "../../Types";
|
|
1305
1396
|
import { Components } from "../../Components";
|
|
1306
|
-
|
|
1307
|
-
|
|
1397
|
+
export interface GridConfig {
|
|
1398
|
+
color: THREE.Color;
|
|
1399
|
+
size1: number;
|
|
1400
|
+
size2: number;
|
|
1401
|
+
distance: number;
|
|
1402
|
+
}
|
|
1308
1403
|
/**
|
|
1309
|
-
*
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1404
|
+
* An infinite grid. Created by
|
|
1405
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1406
|
+
* and translated to typescript by
|
|
1407
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1312
1408
|
*/
|
|
1313
|
-
export declare class
|
|
1314
|
-
/** {@link Component.enabled} */
|
|
1315
|
-
enabled: boolean;
|
|
1316
|
-
components: Components;
|
|
1409
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1317
1410
|
/** {@link Disposable.onDisposed} */
|
|
1318
1411
|
readonly onDisposed: Event<unknown>;
|
|
1319
|
-
/** The position of the mouse in the screen. */
|
|
1320
|
-
readonly mouse: Mouse;
|
|
1321
|
-
readonly three: THREE.Raycaster;
|
|
1322
1412
|
world: World;
|
|
1323
|
-
|
|
1324
|
-
/** {@link
|
|
1325
|
-
|
|
1413
|
+
components: Components;
|
|
1414
|
+
/** {@link Hideable.visible} */
|
|
1415
|
+
get visible(): boolean;
|
|
1416
|
+
/** {@link Hideable.visible} */
|
|
1417
|
+
set visible(visible: boolean);
|
|
1418
|
+
/** The material of the grid. */
|
|
1419
|
+
get material(): THREE.ShaderMaterial;
|
|
1326
1420
|
/**
|
|
1327
|
-
*
|
|
1328
|
-
*
|
|
1329
|
-
* used by the renderer.
|
|
1330
|
-
*
|
|
1331
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1332
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1333
|
-
* {@link Components.meshes}.
|
|
1421
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1422
|
+
* perspective cameras and false for orthographic cameras.
|
|
1334
1423
|
*/
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1424
|
+
get fade(): boolean;
|
|
1425
|
+
/**
|
|
1426
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1427
|
+
* perspective cameras and false for orthographic cameras.
|
|
1428
|
+
*/
|
|
1429
|
+
set fade(active: boolean);
|
|
1430
|
+
private readonly _grid;
|
|
1431
|
+
private _fade;
|
|
1432
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1433
|
+
[Symbol.dispose](): void;
|
|
1434
|
+
/** {@link Component.get} */
|
|
1435
|
+
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1436
|
+
/** {@link Disposable.dispose} */
|
|
1437
|
+
dispose(): void;
|
|
1438
|
+
private setupEvents;
|
|
1439
|
+
private updateZoom;
|
|
1339
1440
|
}
|
|
1340
1441
|
/**
|
|
1341
1442
|
* Simple event handler by
|
|
@@ -1528,6 +1629,24 @@ export interface BVHGeometry extends THREE.BufferGeometry {
|
|
|
1528
1629
|
export interface CameraControllable {
|
|
1529
1630
|
controls: CameraControls;
|
|
1530
1631
|
}
|
|
1632
|
+
import { Base } from "./base";
|
|
1633
|
+
/**
|
|
1634
|
+
* Components are the building blocks of this library. Components are singleton
|
|
1635
|
+
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1636
|
+
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1637
|
+
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1638
|
+
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1639
|
+
* instance.
|
|
1640
|
+
*/
|
|
1641
|
+
export declare abstract class Component extends Base {
|
|
1642
|
+
/**
|
|
1643
|
+
* Whether this component is active or not. The behaviour can vary depending
|
|
1644
|
+
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1645
|
+
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1646
|
+
* will not be updated automatically each frame.
|
|
1647
|
+
*/
|
|
1648
|
+
abstract enabled: boolean;
|
|
1649
|
+
}
|
|
1531
1650
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1532
1651
|
import { Components } from "../../Components";
|
|
1533
1652
|
/**
|
|
@@ -1564,24 +1683,6 @@ export declare abstract class BaseWorldItem extends Base {
|
|
|
1564
1683
|
currentWorld: World | null;
|
|
1565
1684
|
protected constructor(components: Components);
|
|
1566
1685
|
}
|
|
1567
|
-
import { Base } from "./base";
|
|
1568
|
-
/**
|
|
1569
|
-
* Components are the building blocks of this library. Components are singleton
|
|
1570
|
-
* elements that contain specific functionality. For instance, the SimpleClipper
|
|
1571
|
-
* Component can create, delete and handle 3D clipping planes. Components must be
|
|
1572
|
-
* unique (they can't be instanced more than once), and have a static UUID that
|
|
1573
|
-
* identifies them uniquely. The can be accessed globally using the {@link Components}
|
|
1574
|
-
* instance.
|
|
1575
|
-
*/
|
|
1576
|
-
export declare abstract class Component extends Base {
|
|
1577
|
-
/**
|
|
1578
|
-
* Whether this component is active or not. The behaviour can vary depending
|
|
1579
|
-
* on the type of component. E.g. a disabled dimension tool will stop creating
|
|
1580
|
-
* dimensions, while a disabled camera will stop moving. A disabled component
|
|
1581
|
-
* will not be updated automatically each frame.
|
|
1582
|
-
*/
|
|
1583
|
-
abstract enabled: boolean;
|
|
1584
|
-
}
|
|
1585
1686
|
import * as THREE from "three";
|
|
1586
1687
|
import { Vector2 } from "three";
|
|
1587
1688
|
import { Event } from "./event";
|
|
@@ -1619,153 +1720,44 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1619
1720
|
* Adds or removes a
|
|
1620
1721
|
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
1621
1722
|
* to the renderer.
|
|
1622
|
-
*/
|
|
1623
|
-
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1624
|
-
}
|
|
1625
|
-
import * as THREE from "three";
|
|
1626
|
-
import
|
|
1627
|
-
import {
|
|
1628
|
-
import {
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
}
|
|
1636
|
-
import * as THREE from "three";
|
|
1637
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1638
|
-
import { Components } from "../../Components";
|
|
1639
|
-
/**
|
|
1640
|
-
* Each of the planes created by {@link SimpleClipper}.
|
|
1641
|
-
*/
|
|
1642
|
-
export declare class SimplePlane implements Disposable, Hideable {
|
|
1643
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
1644
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
1645
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
1646
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
1647
|
-
/** {@link Disposable.onDisposed} */
|
|
1648
|
-
readonly onDisposed: Event<unknown>;
|
|
1649
|
-
readonly normal: THREE.Vector3;
|
|
1650
|
-
readonly origin: THREE.Vector3;
|
|
1651
|
-
readonly three: THREE.Plane;
|
|
1652
|
-
protected readonly _helper: THREE.Object3D;
|
|
1653
|
-
protected _visible: boolean;
|
|
1654
|
-
protected _enabled: boolean;
|
|
1655
|
-
components: Components;
|
|
1656
|
-
world: World;
|
|
1657
|
-
private _controlsActive;
|
|
1658
|
-
private readonly _arrowBoundBox;
|
|
1659
|
-
private readonly _planeMesh;
|
|
1660
|
-
private readonly _controls;
|
|
1661
|
-
private readonly _hiddenMaterial;
|
|
1662
|
-
get enabled(): boolean;
|
|
1663
|
-
/** {@link Component.enabled} */
|
|
1664
|
-
set enabled(state: boolean);
|
|
1665
|
-
/** {@link Hideable.visible } */
|
|
1666
|
-
get visible(): boolean;
|
|
1667
|
-
/** {@link Hideable.visible } */
|
|
1668
|
-
set visible(state: boolean);
|
|
1669
|
-
/** The meshes used for raycasting */
|
|
1670
|
-
get meshes(): THREE.Mesh[];
|
|
1671
|
-
/** The material of the clipping plane representation. */
|
|
1672
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
1673
|
-
/** The material of the clipping plane representation. */
|
|
1674
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
1675
|
-
/** The size of the clipping plane representation. */
|
|
1676
|
-
get size(): number;
|
|
1677
|
-
/** Sets the size of the clipping plane representation. */
|
|
1678
|
-
set size(size: number);
|
|
1679
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1680
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1681
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): Promise<void>;
|
|
1682
|
-
/** {@link Updateable.update} */
|
|
1683
|
-
update: () => Promise<void>;
|
|
1684
|
-
/** {@link Disposable.dispose} */
|
|
1685
|
-
dispose(): void;
|
|
1686
|
-
private reset;
|
|
1687
|
-
protected toggleControls(state: boolean): void;
|
|
1688
|
-
private newTransformControls;
|
|
1689
|
-
private initializeControls;
|
|
1690
|
-
private createArrowBoundingBox;
|
|
1691
|
-
private changeDrag;
|
|
1692
|
-
private notifyDraggingChanged;
|
|
1693
|
-
private preventCameraMovement;
|
|
1694
|
-
private newHelper;
|
|
1695
|
-
private static newPlaneMesh;
|
|
1696
|
-
}
|
|
1697
|
-
import * as THREE from "three";
|
|
1698
|
-
import { Disposable } from "./interfaces";
|
|
1699
|
-
import { Event } from "./event";
|
|
1700
|
-
import { Components } from "../../Components";
|
|
1701
|
-
import { BaseWorldItem } from "./base-world-item";
|
|
1702
|
-
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1703
|
-
/** {@link Disposable.onDisposed} */
|
|
1704
|
-
readonly onDisposed: Event<unknown>;
|
|
1705
|
-
abstract three: THREE.Object3D;
|
|
1706
|
-
protected constructor(components: Components);
|
|
1707
|
-
/** {@link Disposable.dispose} */
|
|
1708
|
-
dispose(): void;
|
|
1709
|
-
}
|
|
1710
|
-
import * as THREE from "three";
|
|
1711
|
-
import { BaseScene } from "./base-scene";
|
|
1712
|
-
import { BaseCamera } from "./base-camera";
|
|
1713
|
-
import { BaseRenderer } from "./base-renderer";
|
|
1714
|
-
import { Updateable, Disposable } from "./interfaces";
|
|
1715
|
-
export interface World extends Disposable, Updateable {
|
|
1716
|
-
meshes: Set<THREE.Mesh>;
|
|
1717
|
-
scene: BaseScene;
|
|
1718
|
-
camera: BaseCamera;
|
|
1719
|
-
renderer: BaseRenderer | null;
|
|
1720
|
-
uuid: string;
|
|
1721
|
-
}
|
|
1722
|
-
/// <reference types="node" />
|
|
1723
|
-
import * as THREE from "three";
|
|
1724
|
-
import { Hideable, Event, World } from "../../Types";
|
|
1725
|
-
import { Components } from "../../Components";
|
|
1726
|
-
export interface GridConfig {
|
|
1727
|
-
color: THREE.Color;
|
|
1728
|
-
size1: number;
|
|
1729
|
-
size2: number;
|
|
1730
|
-
distance: number;
|
|
1731
|
-
}
|
|
1732
|
-
/**
|
|
1733
|
-
* An infinite grid. Created by
|
|
1734
|
-
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1735
|
-
* and translated to typescript by
|
|
1736
|
-
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1737
|
-
*/
|
|
1738
|
-
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1739
|
-
/** {@link Disposable.onDisposed} */
|
|
1740
|
-
readonly onDisposed: Event<unknown>;
|
|
1741
|
-
world: World;
|
|
1742
|
-
components: Components;
|
|
1743
|
-
/** {@link Hideable.visible} */
|
|
1744
|
-
get visible(): boolean;
|
|
1745
|
-
/** {@link Hideable.visible} */
|
|
1746
|
-
set visible(visible: boolean);
|
|
1747
|
-
/** The material of the grid. */
|
|
1748
|
-
get material(): THREE.ShaderMaterial;
|
|
1749
|
-
/**
|
|
1750
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1751
|
-
* perspective cameras and false for orthographic cameras.
|
|
1752
|
-
*/
|
|
1753
|
-
get fade(): boolean;
|
|
1754
|
-
/**
|
|
1755
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1756
|
-
* perspective cameras and false for orthographic cameras.
|
|
1757
|
-
*/
|
|
1758
|
-
set fade(active: boolean);
|
|
1759
|
-
private readonly _grid;
|
|
1760
|
-
private _fade;
|
|
1761
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
1762
|
-
[Symbol.dispose](): void;
|
|
1763
|
-
/** {@link Component.get} */
|
|
1764
|
-
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1723
|
+
*/
|
|
1724
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1725
|
+
}
|
|
1726
|
+
import * as THREE from "three";
|
|
1727
|
+
import { Disposable } from "./interfaces";
|
|
1728
|
+
import { Event } from "./event";
|
|
1729
|
+
import { Components } from "../../Components";
|
|
1730
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1731
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1732
|
+
/** {@link Disposable.onDisposed} */
|
|
1733
|
+
readonly onDisposed: Event<unknown>;
|
|
1734
|
+
abstract three: THREE.Object3D;
|
|
1735
|
+
protected constructor(components: Components);
|
|
1765
1736
|
/** {@link Disposable.dispose} */
|
|
1766
1737
|
dispose(): void;
|
|
1767
|
-
|
|
1768
|
-
|
|
1738
|
+
}
|
|
1739
|
+
import * as THREE from "three";
|
|
1740
|
+
import CameraControls from "camera-controls";
|
|
1741
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1742
|
+
import { CameraControllable } from "./interfaces";
|
|
1743
|
+
export declare abstract class BaseCamera extends BaseWorldItem {
|
|
1744
|
+
abstract enabled: boolean;
|
|
1745
|
+
abstract three: THREE.Camera;
|
|
1746
|
+
abstract controls?: CameraControls;
|
|
1747
|
+
/** Whether is instance is {@link CameraControllable}. */
|
|
1748
|
+
hasCameraControls: () => this is CameraControllable;
|
|
1749
|
+
}
|
|
1750
|
+
import * as THREE from "three";
|
|
1751
|
+
import { BaseScene } from "./base-scene";
|
|
1752
|
+
import { BaseCamera } from "./base-camera";
|
|
1753
|
+
import { BaseRenderer } from "./base-renderer";
|
|
1754
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
1755
|
+
export interface World extends Disposable, Updateable {
|
|
1756
|
+
meshes: Set<THREE.Mesh>;
|
|
1757
|
+
scene: BaseScene;
|
|
1758
|
+
camera: BaseCamera;
|
|
1759
|
+
renderer: BaseRenderer | null;
|
|
1760
|
+
uuid: string;
|
|
1769
1761
|
}
|
|
1770
1762
|
import * as THREE from "three";
|
|
1771
1763
|
import { Components } from "../../Components";
|
|
@@ -1834,51 +1826,21 @@ export declare class CullerRenderer {
|
|
|
1834
1826
|
protected decreaseColor(): void;
|
|
1835
1827
|
private applySettings;
|
|
1836
1828
|
}
|
|
1837
|
-
import
|
|
1838
|
-
/**
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
/**
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
absolute: boolean;
|
|
1853
|
-
logLevel?: WEBIFC.LogLevel;
|
|
1854
|
-
};
|
|
1855
|
-
/** List of categories that won't be converted to fragments. */
|
|
1856
|
-
excludedCategories: Set<number>;
|
|
1857
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
1858
|
-
saveLocations: boolean;
|
|
1859
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1860
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1861
|
-
autoSetWasm: boolean;
|
|
1862
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1863
|
-
}
|
|
1864
|
-
import * as THREE from "three";
|
|
1865
|
-
import * as WEBIFC from "web-ifc";
|
|
1866
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1867
|
-
export declare class CivilReader {
|
|
1868
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1869
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1870
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1871
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1872
|
-
} | undefined;
|
|
1873
|
-
get(civilItems: any): {
|
|
1874
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1875
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1876
|
-
} | undefined;
|
|
1877
|
-
private getCurves;
|
|
1878
|
-
}
|
|
1879
|
-
import * as WEBIFC from "web-ifc";
|
|
1880
|
-
export declare class IfcMetadataReader {
|
|
1881
|
-
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1829
|
+
import { NavigationMode } from "./types";
|
|
1830
|
+
/**
|
|
1831
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1832
|
+
* simulating FPS video games.
|
|
1833
|
+
*/
|
|
1834
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1835
|
+
private camera;
|
|
1836
|
+
/** {@link NavigationMode.enabled} */
|
|
1837
|
+
enabled: boolean;
|
|
1838
|
+
/** {@link NavigationMode.id} */
|
|
1839
|
+
readonly id = "FirstPerson";
|
|
1840
|
+
constructor(camera: any);
|
|
1841
|
+
/** {@link NavigationMode.set} */
|
|
1842
|
+
set(active: boolean): void;
|
|
1843
|
+
private setupFirstPersonCamera;
|
|
1882
1844
|
}
|
|
1883
1845
|
import * as THREE from "three";
|
|
1884
1846
|
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
@@ -1909,67 +1871,110 @@ export declare class MeshCullerRenderer extends CullerRenderer {
|
|
|
1909
1871
|
private getAvailableMaterial;
|
|
1910
1872
|
}
|
|
1911
1873
|
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1912
|
-
import
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
[id: number]: any;
|
|
1921
|
-
};
|
|
1922
|
-
}>;
|
|
1923
|
-
onProgress: AsyncEvent<number>;
|
|
1924
|
-
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1925
|
-
/** {@link Disposable.onDisposed} */
|
|
1926
|
-
readonly onDisposed: Event<string>;
|
|
1874
|
+
import { NavigationMode } from "./types";
|
|
1875
|
+
/**
|
|
1876
|
+
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1877
|
+
* like in many 3D and CAD softwares.
|
|
1878
|
+
*/
|
|
1879
|
+
export declare class OrbitMode implements NavigationMode {
|
|
1880
|
+
camera: any;
|
|
1881
|
+
/** {@link NavigationMode.enabled} */
|
|
1927
1882
|
enabled: boolean;
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
private
|
|
1934
|
-
private streamIfcFile;
|
|
1935
|
-
private streamAllProperties;
|
|
1936
|
-
private getIndices;
|
|
1937
|
-
private cleanUp;
|
|
1938
|
-
}
|
|
1939
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1940
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1941
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1942
|
-
minGeometrySize: number;
|
|
1943
|
-
minAssetsSize: number;
|
|
1883
|
+
/** {@link NavigationMode.id} */
|
|
1884
|
+
readonly id = "Orbit";
|
|
1885
|
+
constructor(camera: any);
|
|
1886
|
+
/** {@link NavigationMode.set} */
|
|
1887
|
+
set(active: boolean): void;
|
|
1888
|
+
private activateOrbitControls;
|
|
1944
1889
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1890
|
+
import { NavigationMode } from "./types";
|
|
1891
|
+
/**
|
|
1892
|
+
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1893
|
+
* like many BIM tools.
|
|
1894
|
+
*/
|
|
1895
|
+
export declare class PlanMode implements NavigationMode {
|
|
1896
|
+
private camera;
|
|
1897
|
+
/** {@link NavigationMode.enabled} */
|
|
1898
|
+
enabled: boolean;
|
|
1899
|
+
/** {@link NavigationMode.id} */
|
|
1900
|
+
readonly id = "Plan";
|
|
1901
|
+
private mouseAction1?;
|
|
1902
|
+
private mouseAction2?;
|
|
1903
|
+
private mouseInitialized;
|
|
1904
|
+
private readonly defaultAzimuthSpeed;
|
|
1905
|
+
private readonly defaultPolarSpeed;
|
|
1906
|
+
constructor(camera: any);
|
|
1907
|
+
/** {@link NavigationMode.set} */
|
|
1908
|
+
set(active: boolean): void;
|
|
1948
1909
|
}
|
|
1949
|
-
import * as WEBIFC from "web-ifc";
|
|
1950
1910
|
import * as THREE from "three";
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1911
|
+
import { CameraProjection } from "./types";
|
|
1912
|
+
import { Event } from "../../../core";
|
|
1913
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1914
|
+
/**
|
|
1915
|
+
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1916
|
+
*/
|
|
1917
|
+
export declare class ProjectionManager {
|
|
1918
|
+
/**
|
|
1919
|
+
* Event that fires when the {@link CameraProjection} changes.
|
|
1920
|
+
*/
|
|
1921
|
+
readonly onChanged: Event<THREE.Camera>;
|
|
1922
|
+
current: CameraProjection;
|
|
1923
|
+
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1924
|
+
private _component;
|
|
1925
|
+
private _previousDistance;
|
|
1926
|
+
/** Match Ortho zoom with Perspective distance when changing projection mode */
|
|
1927
|
+
matchOrthoDistanceEnabled: boolean;
|
|
1928
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1929
|
+
/**
|
|
1930
|
+
* Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
1931
|
+
*
|
|
1932
|
+
* @param projection - the new projection to set. If it is the current projection,
|
|
1933
|
+
* it will have no effect.
|
|
1934
|
+
*/
|
|
1935
|
+
set(projection: CameraProjection): Promise<void>;
|
|
1936
|
+
/**
|
|
1937
|
+
* Changes the current {@link CameraProjection} from Ortographic to Perspective
|
|
1938
|
+
* and vice versa.
|
|
1939
|
+
*/
|
|
1940
|
+
toggle(): Promise<void>;
|
|
1941
|
+
private setOrthoCamera;
|
|
1942
|
+
private getDims;
|
|
1943
|
+
private setupOrthoCamera;
|
|
1944
|
+
private getDistance;
|
|
1945
|
+
private setPerspectiveCamera;
|
|
1958
1946
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1947
|
+
/**
|
|
1948
|
+
* The projection system of the camera.
|
|
1949
|
+
*/
|
|
1950
|
+
export type CameraProjection = "Perspective" | "Orthographic";
|
|
1951
|
+
/**
|
|
1952
|
+
* The extensible list of supported navigation modes.
|
|
1953
|
+
*/
|
|
1954
|
+
export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
|
|
1955
|
+
/**
|
|
1956
|
+
* An object that determines the behavior of the camera controls
|
|
1957
|
+
* and the user input (e.g. 2D floor plan mode, first person mode, etc).
|
|
1958
|
+
*/
|
|
1959
|
+
export interface NavigationMode {
|
|
1960
|
+
/** The unique ID of this navigation mode. */
|
|
1961
|
+
id: NavModeID;
|
|
1962
|
+
/**
|
|
1963
|
+
* Enable or disable this navigation mode.
|
|
1964
|
+
* When a new navigation mode is enabled, the previous navigation mode
|
|
1965
|
+
* must be disabled.
|
|
1966
|
+
*
|
|
1967
|
+
* @param active - whether to enable or disable this mode.
|
|
1968
|
+
* @param options - any additional data required to enable or disable it.
|
|
1969
|
+
* */
|
|
1970
|
+
set: (active: boolean, options?: any) => void;
|
|
1971
|
+
/** Whether this navigation mode is active or not. */
|
|
1972
|
+
enabled: boolean;
|
|
1965
1973
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
transformation: number[];
|
|
1971
|
-
color: number[];
|
|
1972
|
-
}[];
|
|
1974
|
+
import { BufferGeometry } from "three";
|
|
1975
|
+
import * as THREE from "three";
|
|
1976
|
+
export declare class TransformHelper {
|
|
1977
|
+
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1973
1978
|
}
|
|
1974
1979
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1975
1980
|
export interface ModelsRelationMap {
|
|
@@ -1995,11 +2000,6 @@ export type InverseAttributes = [
|
|
|
1995
2000
|
"ContainsElements"
|
|
1996
2001
|
];
|
|
1997
2002
|
export type InverseAttribute = InverseAttributes[number];
|
|
1998
|
-
import { BufferGeometry } from "three";
|
|
1999
|
-
import * as THREE from "three";
|
|
2000
|
-
export declare class TransformHelper {
|
|
2001
|
-
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
2002
|
-
}
|
|
2003
2003
|
export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
|
|
2004
2004
|
export type ConditionFunctions = {
|
|
2005
2005
|
[queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
|