@thatopen/components 2.0.0-alpha.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Clipper/index.d.ts +8 -12
- package/dist/core/Clipper/src/simple-plane.d.ts +2 -2
- package/dist/core/Cullers/index.d.ts +32 -2
- package/dist/core/Grids/index.d.ts +1 -1
- package/dist/core/Grids/src/simple-grid.d.ts +1 -3
- package/dist/core/MiniMap/index.d.ts +3 -2
- package/dist/core/MiniMap/src/index.d.ts +1 -1
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +7 -5
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +2 -1
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +3 -2
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +2 -1
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +3 -3
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +1 -1
- package/dist/core/Worlds/index.d.ts +35 -0
- package/dist/core/Worlds/src/simple-camera.d.ts +1 -1
- package/dist/core/Worlds/src/simple-renderer.d.ts +2 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/fragments/{BoundingBoxes → BoundingBoxer}/index.d.ts +1 -1
- package/dist/fragments/{FragmentClassifier → Classifier}/index.d.ts +1 -1
- package/dist/fragments/{FragmentExploder → Exploder}/index.d.ts +3 -5
- package/dist/fragments/{FragmentManager → FragmentsManager}/index.d.ts +14 -6
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +1 -1
- package/dist/fragments/{FragmentIfcLoader → IfcLoader}/index.d.ts +1 -2
- package/dist/fragments/index.d.ts +6 -6
- package/dist/ifc/IfcJsonExporter/index.d.ts +6 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +1 -2
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +5 -8
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +3 -2
- package/dist/ifc/index.d.ts +0 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +2215 -2426
- package/dist/measurement/Utils/index.d.ts +9 -5
- package/dist/namespace.d.ts +1074 -1112
- package/dist/utils/vertex-picker.d.ts +2 -5
- package/package.json +73 -73
- package/dist/core/Materials/index.d.ts +0 -49
- package/dist/ifc/IfcPropertiesFinder/index.d.ts +0 -37
- package/dist/ifc/IfcPropertiesFinder/src/types.d.ts +0 -23
- package/dist/ifc/IfcRelationsIndexer/src/getRelationMap.d.ts +0 -3
- /package/dist/fragments/{FragmentHider → Hider}/index.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/civil-reader.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/ifc-fragment-settings.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/ifc-metadata-reader.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/index.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/spatial-structure.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/transform-helper.d.ts +0 -0
- /package/dist/fragments/{FragmentIfcLoader → IfcLoader}/src/units.d.ts +0 -0
package/dist/namespace.d.ts
CHANGED
|
@@ -1,167 +1,55 @@
|
|
|
1
1
|
declare namespace OBC {
|
|
2
|
-
import
|
|
3
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
4
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
5
|
-
import { RelationsMap, ModelsRelationMap, InverseAttributes, InverseAttribute } from "./src/types";
|
|
2
|
+
import { Component, Disposable, Event } from "../Types";
|
|
6
3
|
/**
|
|
7
|
-
*
|
|
8
|
-
* It
|
|
4
|
+
* The entry point of the Components library.
|
|
5
|
+
* It can:
|
|
6
|
+
* - Create and access all the components of the library.
|
|
7
|
+
* - Update all the updatable components automatically.
|
|
8
|
+
* - Dispose all the components, preventing memory leaks.
|
|
9
9
|
*/
|
|
10
|
-
export declare class
|
|
11
|
-
static readonly
|
|
10
|
+
export declare class Components implements Disposable {
|
|
11
|
+
static readonly release = "1.4.21";
|
|
12
12
|
/** {@link Disposable.onDisposed} */
|
|
13
|
-
readonly onDisposed: Event<
|
|
13
|
+
readonly onDisposed: Event<void>;
|
|
14
|
+
/** The list of components created in this app. */
|
|
15
|
+
readonly list: Map<string, Component>;
|
|
16
|
+
/** If disabled, the animation loop will be stopped. */
|
|
14
17
|
enabled: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
relationsMap: RelationsMap;
|
|
18
|
-
}>;
|
|
19
|
-
private _relToAttributesMap;
|
|
20
|
-
/**
|
|
21
|
-
* Array of inverse attribute names.
|
|
22
|
-
* This array is used to define the inverse attributes that the indexer will process and index.
|
|
23
|
-
*/
|
|
24
|
-
readonly inverseAttributes: InverseAttributes;
|
|
25
|
-
/**
|
|
26
|
-
* Holds the relationship mappings for each model processed by the indexer.
|
|
27
|
-
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
28
|
-
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
29
|
-
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
30
|
-
* that are related through that relation type. This structure allows for efficient querying
|
|
31
|
-
* of entity relationships within a model.
|
|
32
|
-
*/
|
|
33
|
-
readonly relationMaps: ModelsRelationMap;
|
|
34
|
-
constructor(components: Components);
|
|
35
|
-
private onFragmentsDisposed;
|
|
36
|
-
private getAttributeRels;
|
|
37
|
-
/**
|
|
38
|
-
* Adds a relation map to the model's relations map.
|
|
39
|
-
*
|
|
40
|
-
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
41
|
-
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
42
|
-
*
|
|
43
|
-
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
44
|
-
*/
|
|
45
|
-
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
46
|
-
/**
|
|
47
|
-
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
48
|
-
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
49
|
-
* and maps them in a structured way to facilitate quick access to related entities.
|
|
50
|
-
*
|
|
51
|
-
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
52
|
-
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
53
|
-
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
54
|
-
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
55
|
-
* of entities that are related through that attribute.
|
|
56
|
-
*
|
|
57
|
-
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
58
|
-
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
59
|
-
* representation of the relations indexed by entity expressIDs and relation types.
|
|
60
|
-
* @throws An error if the model does not have properties loaded.
|
|
61
|
-
*/
|
|
62
|
-
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
18
|
+
private _clock;
|
|
19
|
+
add(uuid: string, instance: Component): void;
|
|
63
20
|
/**
|
|
64
|
-
*
|
|
21
|
+
* Retrieves a component. If it already exists in this app, it returns the instance of the component. If it
|
|
22
|
+
* doesn't exist, it will instance it automatically.
|
|
65
23
|
*
|
|
66
|
-
* @param
|
|
67
|
-
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
68
|
-
* @returns A promise that resolves to the relations map for the processed model.
|
|
69
|
-
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
24
|
+
* @param Component - The component to get or create.
|
|
70
25
|
*/
|
|
71
|
-
|
|
26
|
+
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
27
|
+
constructor();
|
|
72
28
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* @param model The 'FragmentsGroup' model containing the entity.
|
|
78
|
-
* @param expressID The unique identifier of the entity within the model.
|
|
79
|
-
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
80
|
-
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
81
|
-
* or the specified relation name is not indexed.
|
|
29
|
+
* Initializes the library. It should be called at the start of the app after
|
|
30
|
+
* initializing the scene, the renderer and the
|
|
31
|
+
* camera. Additionally, if any component that need a raycaster is
|
|
32
|
+
* used, the {@link raycaster} will need to be initialized.
|
|
82
33
|
*/
|
|
83
|
-
|
|
34
|
+
init(): void;
|
|
84
35
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
88
|
-
* The resulting object is then serialized into a JSON string.
|
|
36
|
+
* Disposes the memory of all the components and tools of this instance of
|
|
37
|
+
* the library. A memory leak will be created if:
|
|
89
38
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
serializeRelations(relationMap: RelationsMap): string;
|
|
94
|
-
/**
|
|
95
|
-
* Serializes the relations of a specific model into a JSON string.
|
|
96
|
-
* This method iterates through the relations indexed for the given model,
|
|
97
|
-
* organizing them into a structured object where each key is an expressID of an entity,
|
|
98
|
-
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
99
|
-
* The resulting object is then serialized into a JSON string.
|
|
39
|
+
* - An instance of the library ends up out of scope and this function isn't
|
|
40
|
+
* called. This is especially relevant in Single Page Applications (React,
|
|
41
|
+
* Angular, Vue, etc).
|
|
100
42
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* If the model has no indexed relations, 'null' is returned.
|
|
104
|
-
*/
|
|
105
|
-
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
106
|
-
/**
|
|
107
|
-
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
108
|
-
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
109
|
-
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
110
|
-
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
111
|
-
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
43
|
+
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
44
|
+
* referenced by a reference type (object or array).
|
|
112
45
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*/
|
|
116
|
-
serializeAllRelations(): string;
|
|
117
|
-
/**
|
|
118
|
-
* Converts a JSON string representing relations between entities into a structured map.
|
|
119
|
-
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
120
|
-
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
121
|
-
* and the values are maps where each key is a relation type ID and its value is an array
|
|
122
|
-
* of express IDs of entities related through that relation type.
|
|
46
|
+
* You can learn more about how Three.js handles memory leaks
|
|
47
|
+
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
123
48
|
*
|
|
124
|
-
* @param json The JSON string to be parsed into the relations map.
|
|
125
|
-
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
126
|
-
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
127
|
-
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
128
|
-
*/
|
|
129
|
-
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
130
|
-
/**
|
|
131
|
-
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
132
|
-
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
133
|
-
* references that could prevent garbage collection.
|
|
134
|
-
*/
|
|
135
|
-
dispose(): void;
|
|
136
|
-
}
|
|
137
|
-
import * as WEBIFC from "web-ifc";
|
|
138
|
-
import * as FRAG from "@thatopen/fragments";
|
|
139
|
-
/**
|
|
140
|
-
* Object to export all the properties from an IFC to a JS object.
|
|
141
|
-
*/
|
|
142
|
-
export declare class IfcJsonExporter {
|
|
143
|
-
/**
|
|
144
|
-
* Exports all the properties of an IFC into an array of JS objects.
|
|
145
|
-
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
146
|
-
* @param modelID ID of the IFC model whose properties to extract.
|
|
147
|
-
* @param indirect whether to get the indirect relationships as well.
|
|
148
|
-
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
149
|
-
* to make the location data available (e.g. absolute position of building).
|
|
150
49
|
*/
|
|
151
|
-
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
152
|
-
}
|
|
153
|
-
import { Component, Disposable, World, Event } from "../Types";
|
|
154
|
-
import { SimpleRaycaster } from "./src";
|
|
155
|
-
import { Components } from "../Components";
|
|
156
|
-
export declare class Raycasters extends Component implements Disposable {
|
|
157
|
-
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
158
|
-
enabled: boolean;
|
|
159
|
-
list: Map<string, SimpleRaycaster>;
|
|
160
|
-
onDisposed: Event<unknown>;
|
|
161
|
-
constructor(components: Components);
|
|
162
|
-
get(world: World): SimpleRaycaster;
|
|
163
|
-
delete(world: World): void;
|
|
164
50
|
dispose(): void;
|
|
51
|
+
private update;
|
|
52
|
+
private static setupBVH;
|
|
165
53
|
}
|
|
166
54
|
import * as THREE from "three";
|
|
167
55
|
import { Components } from "../Components";
|
|
@@ -206,206 +94,70 @@ export declare class Disposer extends Component {
|
|
|
206
94
|
private disposeChildren;
|
|
207
95
|
private static disposeMaterial;
|
|
208
96
|
}
|
|
209
|
-
import { Component, Disposable, Event } from "../Types";
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* - Update all the updatable components automatically.
|
|
215
|
-
* - Dispose all the components, preventing memory leaks.
|
|
216
|
-
*/
|
|
217
|
-
export declare class Components implements Disposable {
|
|
218
|
-
static readonly release = "1.4.21";
|
|
219
|
-
/** {@link Disposable.onDisposed} */
|
|
220
|
-
readonly onDisposed: Event<void>;
|
|
221
|
-
/** The list of components created in this app. */
|
|
222
|
-
readonly list: Map<string, Component>;
|
|
223
|
-
/** If disabled, the animation loop will be stopped. */
|
|
97
|
+
import { Component, Disposable, World, Event } from "../Types";
|
|
98
|
+
import { SimpleRaycaster } from "./src";
|
|
99
|
+
import { Components } from "../Components";
|
|
100
|
+
export declare class Raycasters extends Component implements Disposable {
|
|
101
|
+
static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
|
|
224
102
|
enabled: boolean;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
*
|
|
231
|
-
* @param Component - The component to get or create.
|
|
232
|
-
*/
|
|
233
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
234
|
-
constructor();
|
|
235
|
-
/**
|
|
236
|
-
* Initializes the library. It should be called at the start of the app after
|
|
237
|
-
* initializing the scene, the renderer and the
|
|
238
|
-
* camera. Additionally, if any component that need a raycaster is
|
|
239
|
-
* used, the {@link raycaster} will need to be initialized.
|
|
240
|
-
*/
|
|
241
|
-
init(): void;
|
|
242
|
-
/**
|
|
243
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
244
|
-
* the library. A memory leak will be created if:
|
|
245
|
-
*
|
|
246
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
247
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
248
|
-
* Angular, Vue, etc).
|
|
249
|
-
*
|
|
250
|
-
* - Any of the objects of this instance (meshes, geometries, etc) is
|
|
251
|
-
* referenced by a reference type (object or array).
|
|
252
|
-
*
|
|
253
|
-
* You can learn more about how Three.js handles memory leaks
|
|
254
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
255
|
-
*
|
|
256
|
-
*/
|
|
103
|
+
list: Map<string, SimpleRaycaster>;
|
|
104
|
+
onDisposed: Event<unknown>;
|
|
105
|
+
constructor(components: Components);
|
|
106
|
+
get(world: World): SimpleRaycaster;
|
|
107
|
+
delete(world: World): void;
|
|
257
108
|
dispose(): void;
|
|
258
|
-
private update;
|
|
259
|
-
private static setupBVH;
|
|
260
109
|
}
|
|
261
110
|
import { Component, Disposable, Updateable, World, Event, BaseScene, BaseCamera, BaseRenderer } from "../Types";
|
|
262
111
|
import { Components } from "../Components";
|
|
263
112
|
import { SimpleWorld } from "./src";
|
|
264
113
|
export declare class Worlds extends Component implements Updateable, Disposable {
|
|
114
|
+
/**
|
|
115
|
+
* A unique identifier for the component.
|
|
116
|
+
* This UUID is used to register the component within the Components system.
|
|
117
|
+
*/
|
|
265
118
|
static readonly uuid: "fdb61dc4-2ec1-4966-b83d-54ea795fad4a";
|
|
119
|
+
/**
|
|
120
|
+
* Event triggered after the update process of all worlds.
|
|
121
|
+
* Subscribers can listen to this event to perform actions post-update.
|
|
122
|
+
*/
|
|
266
123
|
readonly onAfterUpdate: Event<unknown>;
|
|
124
|
+
/**
|
|
125
|
+
* Event triggered before the update process of all worlds.
|
|
126
|
+
* Subscribers can listen to this event to perform actions pre-update.
|
|
127
|
+
*/
|
|
267
128
|
readonly onBeforeUpdate: Event<unknown>;
|
|
129
|
+
/**
|
|
130
|
+
* Event triggered when the Worlds component is disposed.
|
|
131
|
+
* Subscribers can listen to this event to perform cleanup actions.
|
|
132
|
+
*/
|
|
268
133
|
readonly onDisposed: Event<unknown>;
|
|
134
|
+
/**
|
|
135
|
+
* A collection of worlds managed by this component.
|
|
136
|
+
* The key is the unique identifier (UUID) of the world, and the value is the World instance.
|
|
137
|
+
*/
|
|
269
138
|
list: Map<string, World>;
|
|
139
|
+
/**
|
|
140
|
+
* A flag indicating whether the Worlds component is enabled.
|
|
141
|
+
* If false, the update process will be skipped.
|
|
142
|
+
*/
|
|
270
143
|
enabled: boolean;
|
|
271
144
|
constructor(components: Components);
|
|
145
|
+
/**
|
|
146
|
+
* Creates a new instance of a SimpleWorld and adds it to the list of worlds.
|
|
147
|
+
*
|
|
148
|
+
* @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
|
|
149
|
+
* @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
|
|
150
|
+
* @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
|
|
151
|
+
*
|
|
152
|
+
* @returns {SimpleWorld<T, U, S>} - The newly created SimpleWorld instance.
|
|
153
|
+
*
|
|
154
|
+
* @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
|
|
155
|
+
*/
|
|
272
156
|
create<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer>(): SimpleWorld<T, U, S>;
|
|
273
157
|
delete(world: World): void;
|
|
274
158
|
dispose(): void;
|
|
275
159
|
update(delta?: number): void | Promise<void>;
|
|
276
160
|
}
|
|
277
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
278
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
279
|
-
import { Disposable, Event, Component, Components } from "../../core";
|
|
280
|
-
import { QueryGroup } from "./src/types";
|
|
281
|
-
export interface QueryResult {
|
|
282
|
-
[modelID: string]: {
|
|
283
|
-
modelEntities: Set<number>;
|
|
284
|
-
otherEntities: Set<number>;
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
export interface IndexedModels {
|
|
288
|
-
[modelID: string]: {
|
|
289
|
-
[expressID: number]: Set<number>;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
export declare class IfcPropertiesFinder extends Component implements Disposable {
|
|
293
|
-
readonly onFound: Event<FRAGS.FragmentIdMap>;
|
|
294
|
-
/** {@link Disposable.onDisposed} */
|
|
295
|
-
readonly onDisposed: Event<unknown>;
|
|
296
|
-
enabled: boolean;
|
|
297
|
-
indexedModels: IndexedModels;
|
|
298
|
-
private readonly _conditionFunctions;
|
|
299
|
-
private _noHandleAttributes;
|
|
300
|
-
constructor(components: Components);
|
|
301
|
-
private onFragmentsDisposed;
|
|
302
|
-
dispose(): void;
|
|
303
|
-
private indexEntityRelations;
|
|
304
|
-
find(groups: QueryGroup[], queryModels?: FragmentsGroup[]): Promise<FRAGS.FragmentIdMap>;
|
|
305
|
-
private toFragmentMap;
|
|
306
|
-
private simpleQuery;
|
|
307
|
-
private getMatchingEntities;
|
|
308
|
-
private combineArrays;
|
|
309
|
-
private getCommonElements;
|
|
310
|
-
private arrayIntersection;
|
|
311
|
-
private arrayUnion;
|
|
312
|
-
private getConditionFunctions;
|
|
313
|
-
}
|
|
314
|
-
import { Components } from "../Components";
|
|
315
|
-
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
316
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
317
|
-
/**
|
|
318
|
-
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
319
|
-
* that are not visible to the camera.
|
|
320
|
-
*/
|
|
321
|
-
export declare class Cullers extends Component implements Disposable {
|
|
322
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
323
|
-
private _enabled;
|
|
324
|
-
list: Map<string, MeshCullerRenderer>;
|
|
325
|
-
/** {@link Disposable.onDisposed} */
|
|
326
|
-
readonly onDisposed: Event<unknown>;
|
|
327
|
-
/** {@link Component.enabled} */
|
|
328
|
-
get enabled(): boolean;
|
|
329
|
-
set enabled(value: boolean);
|
|
330
|
-
constructor(components: Components);
|
|
331
|
-
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
332
|
-
delete(world: World): void;
|
|
333
|
-
/** {@link Disposable.dispose} */
|
|
334
|
-
dispose(): void;
|
|
335
|
-
}
|
|
336
|
-
import * as WEBIFC from "web-ifc";
|
|
337
|
-
import { FragmentsGroup } from "@thatopen/fragments";
|
|
338
|
-
import { Component, Disposable, Event, Components } from "../../core";
|
|
339
|
-
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
340
|
-
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
341
|
-
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
342
|
-
interface ChangeMap {
|
|
343
|
-
[modelID: string]: Set<number>;
|
|
344
|
-
}
|
|
345
|
-
interface AttributeListener {
|
|
346
|
-
[modelID: string]: {
|
|
347
|
-
[expressID: number]: {
|
|
348
|
-
[attributeName: string]: Event<String | Boolean | Number>;
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
353
|
-
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
354
|
-
/** {@link Disposable.onDisposed} */
|
|
355
|
-
readonly onDisposed: Event<string>;
|
|
356
|
-
readonly onRequestFile: Event<unknown>;
|
|
357
|
-
ifcToExport: ArrayBuffer | null;
|
|
358
|
-
readonly onElementToPset: Event<{
|
|
359
|
-
model: FragmentsGroup;
|
|
360
|
-
psetID: number;
|
|
361
|
-
elementID: number;
|
|
362
|
-
}>;
|
|
363
|
-
readonly onPropToPset: Event<{
|
|
364
|
-
model: FragmentsGroup;
|
|
365
|
-
psetID: number;
|
|
366
|
-
propID: number;
|
|
367
|
-
}>;
|
|
368
|
-
readonly onPsetRemoved: Event<{
|
|
369
|
-
model: FragmentsGroup;
|
|
370
|
-
psetID: number;
|
|
371
|
-
}>;
|
|
372
|
-
readonly onDataChanged: Event<{
|
|
373
|
-
model: FragmentsGroup;
|
|
374
|
-
expressID: number;
|
|
375
|
-
}>;
|
|
376
|
-
wasm: {
|
|
377
|
-
path: string;
|
|
378
|
-
absolute: boolean;
|
|
379
|
-
};
|
|
380
|
-
enabled: boolean;
|
|
381
|
-
attributeListeners: AttributeListener;
|
|
382
|
-
selectedModel?: FragmentsGroup;
|
|
383
|
-
private _changeMap;
|
|
384
|
-
constructor(components: Components);
|
|
385
|
-
get(): ChangeMap;
|
|
386
|
-
dispose(): void;
|
|
387
|
-
private increaseMaxID;
|
|
388
|
-
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
389
|
-
private newGUID;
|
|
390
|
-
private getOwnerHistory;
|
|
391
|
-
private registerChange;
|
|
392
|
-
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
393
|
-
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
394
|
-
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
395
|
-
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
396
|
-
}>;
|
|
397
|
-
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
398
|
-
private newSingleProperty;
|
|
399
|
-
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
400
|
-
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
401
|
-
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
402
|
-
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
403
|
-
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
404
|
-
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
405
|
-
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
406
|
-
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
407
|
-
}
|
|
408
|
-
export {};
|
|
409
161
|
import { Component, Disposable, World, Event } from "../Types";
|
|
410
162
|
import { GridConfig, SimpleGrid } from "./src";
|
|
411
163
|
export declare class Grids extends Component implements Disposable {
|
|
@@ -415,171 +167,61 @@ export declare class Grids extends Component implements Disposable {
|
|
|
415
167
|
config: Required<GridConfig>;
|
|
416
168
|
/** {@link Component.enabled} */
|
|
417
169
|
enabled: boolean;
|
|
418
|
-
create(world: World):
|
|
170
|
+
create(world: World): SimpleGrid;
|
|
419
171
|
delete(world: World): void;
|
|
420
172
|
dispose(): void;
|
|
421
173
|
}
|
|
422
|
-
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
423
|
-
import * as THREE from "three";
|
|
424
|
-
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
425
|
-
center: THREE.Vector3;
|
|
426
|
-
halfSizes: THREE.Vector3;
|
|
427
|
-
rotation: THREE.Matrix3;
|
|
428
|
-
transformation: THREE.Matrix4;
|
|
429
|
-
};
|
|
430
|
-
export declare class UUID {
|
|
431
|
-
private static _pattern;
|
|
432
|
-
private static _lut;
|
|
433
|
-
static create(): string;
|
|
434
|
-
static validate(uuid: string): void;
|
|
435
|
-
}
|
|
436
|
-
import * as THREE from "three";
|
|
437
|
-
export declare class MaterialsUtils {
|
|
438
|
-
static isTransparent(material: THREE.Material): boolean;
|
|
439
|
-
}
|
|
440
|
-
import * as THREE from "three";
|
|
441
|
-
import { Component, Components, Event, World, Disposable } from "../core";
|
|
442
|
-
export interface VertexPickerConfig {
|
|
443
|
-
showOnlyVertex: boolean;
|
|
444
|
-
snapDistance: number;
|
|
445
|
-
previewElement: HTMLElement;
|
|
446
|
-
}
|
|
447
|
-
export declare class VertexPicker extends Component implements Disposable {
|
|
448
|
-
onVertexFound: Event<THREE.Vector3>;
|
|
449
|
-
onVertexLost: Event<THREE.Vector3>;
|
|
450
|
-
components: Components;
|
|
451
|
-
private _pickedPoint;
|
|
452
|
-
private _config;
|
|
453
|
-
private _enabled;
|
|
454
|
-
private _workingPlane;
|
|
455
|
-
/** {@link Disposable.onDisposed} */
|
|
456
|
-
readonly onDisposed: Event<unknown>;
|
|
457
|
-
set enabled(value: boolean);
|
|
458
|
-
get enabled(): boolean;
|
|
459
|
-
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
460
|
-
[Symbol.dispose](): void;
|
|
461
|
-
set workingPlane(plane: THREE.Plane | null);
|
|
462
|
-
get workingPlane(): THREE.Plane | null;
|
|
463
|
-
set config(value: Partial<VertexPickerConfig>);
|
|
464
|
-
get config(): Partial<VertexPickerConfig>;
|
|
465
|
-
dispose(): void;
|
|
466
|
-
get(world: World): THREE.Vector3 | null;
|
|
467
|
-
private getClosestVertex;
|
|
468
|
-
private getVertices;
|
|
469
|
-
private getVertex;
|
|
470
|
-
}
|
|
471
|
-
import { Component, Components, Disposable, Updateable, World, Event } from "../../core";
|
|
472
|
-
import { MiniMap } from "./src";
|
|
473
|
-
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
474
|
-
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
475
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
476
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
477
|
-
readonly onDisposed: Event<unknown>;
|
|
478
|
-
enabled: boolean;
|
|
479
|
-
list: Map<string, MiniMap>;
|
|
480
|
-
constructor(components: Components);
|
|
481
|
-
create(world: World): MiniMap;
|
|
482
|
-
delete(id: string): void;
|
|
483
|
-
dispose(): void | Promise<void>;
|
|
484
|
-
update(): void;
|
|
485
|
-
}
|
|
486
|
-
import * as THREE from "three";
|
|
487
|
-
import { Component, Disposable, Event } from "../Types";
|
|
488
174
|
import { Components } from "../Components";
|
|
175
|
+
import { MeshCullerRenderer, CullerRendererSettings } from "./src";
|
|
176
|
+
import { Component, Event, Disposable, World } from "../Types";
|
|
489
177
|
/**
|
|
490
|
-
* A tool to
|
|
491
|
-
*
|
|
178
|
+
* A tool to handle big scenes efficiently by automatically hiding the objects
|
|
179
|
+
* that are not visible to the camera.
|
|
492
180
|
*/
|
|
493
|
-
export declare class
|
|
494
|
-
static readonly uuid: "24989d27-fa2f-4797-8b08-35918f74e502";
|
|
495
|
-
/** {@link Component.enabled} */
|
|
496
|
-
enabled: boolean;
|
|
497
|
-
/** {@link Disposable.onDisposed} */
|
|
498
|
-
readonly onDisposed: Event<string>;
|
|
499
|
-
list: {
|
|
500
|
-
[id: string]: {
|
|
501
|
-
material: THREE.Material;
|
|
502
|
-
meshes: Set<THREE.Mesh | THREE.InstancedMesh>;
|
|
503
|
-
};
|
|
504
|
-
};
|
|
505
|
-
private _originals;
|
|
506
|
-
constructor(components: Components);
|
|
507
|
-
/** {@link Disposable.dispose} */
|
|
508
|
-
dispose(): void;
|
|
509
|
-
/**
|
|
510
|
-
* Turns the specified material styles on or off.
|
|
511
|
-
*
|
|
512
|
-
* @param active whether to turn it on or off.
|
|
513
|
-
* @param ids the ids of the style to turn on or off.
|
|
514
|
-
*/
|
|
515
|
-
set(active: boolean, ids?: string[]): void;
|
|
181
|
+
export declare class Cullers extends Component implements Disposable {
|
|
516
182
|
/**
|
|
517
|
-
*
|
|
518
|
-
* @param id the identifier of the style to create.
|
|
519
|
-
* @param material the material of the style.
|
|
183
|
+
* A unique identifier for the Cullers component.
|
|
520
184
|
*/
|
|
521
|
-
|
|
185
|
+
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
522
186
|
/**
|
|
523
|
-
*
|
|
524
|
-
* @param id the identifier of the style.
|
|
525
|
-
* @param meshes the meshes to assign to the style.
|
|
187
|
+
* Indicates whether the Cullers component is enabled.
|
|
526
188
|
*/
|
|
527
|
-
|
|
189
|
+
private _enabled;
|
|
528
190
|
/**
|
|
529
|
-
*
|
|
530
|
-
* @param id the identifier of the style.
|
|
531
|
-
* @param meshes the meshes to assign to the style.
|
|
191
|
+
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
532
192
|
*/
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
import * as THREE from "three";
|
|
536
|
-
import { Components } from "../../core/Components";
|
|
537
|
-
import { SimpleCamera } from "../../core";
|
|
538
|
-
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
539
|
-
/**
|
|
540
|
-
* A flexible camera that uses
|
|
541
|
-
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
542
|
-
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
543
|
-
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
544
|
-
*/
|
|
545
|
-
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
193
|
+
list: Map<string, MeshCullerRenderer>;
|
|
546
194
|
/**
|
|
547
|
-
*
|
|
195
|
+
* An event that is triggered when the Cullers component is disposed.
|
|
548
196
|
*/
|
|
549
|
-
|
|
550
|
-
readonly projection: ProjectionManager;
|
|
551
|
-
readonly threeOrtho: THREE.OrthographicCamera;
|
|
552
|
-
protected readonly _userInputButtons: any;
|
|
553
|
-
protected readonly _frustumSize = 50;
|
|
554
|
-
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
555
|
-
get current(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
556
|
-
constructor(components: Components);
|
|
557
|
-
/** {@link Disposable.dispose} */
|
|
558
|
-
dispose(): void;
|
|
197
|
+
readonly onDisposed: Event<unknown>;
|
|
559
198
|
/**
|
|
560
|
-
*
|
|
199
|
+
* Gets the enabled state of the Cullers component.
|
|
561
200
|
*
|
|
562
|
-
* @
|
|
201
|
+
* @returns The current enabled state.
|
|
563
202
|
*/
|
|
564
|
-
|
|
203
|
+
get enabled(): boolean;
|
|
565
204
|
/**
|
|
566
|
-
*
|
|
205
|
+
* Sets the enabled state of the Cullers component.
|
|
206
|
+
* Also sets the enabled state of all MeshCullerRenderer instances.
|
|
567
207
|
*
|
|
568
|
-
* @param
|
|
569
|
-
* evaluate {@link Components.meshes}.
|
|
570
|
-
* @param offset the distance to the fit object
|
|
208
|
+
* @param value - The new enabled state.
|
|
571
209
|
*/
|
|
572
|
-
|
|
210
|
+
set enabled(value: boolean);
|
|
211
|
+
constructor(components: Components);
|
|
573
212
|
/**
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
213
|
+
* Creates a new MeshCullerRenderer for the given world.
|
|
214
|
+
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
215
|
+
*
|
|
216
|
+
* @param world - The world for which to create the MeshCullerRenderer.
|
|
217
|
+
* @param config - Optional configuration settings for the MeshCullerRenderer.
|
|
218
|
+
*
|
|
219
|
+
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
220
|
+
*/
|
|
221
|
+
create(world: World, config?: Partial<CullerRendererSettings>): MeshCullerRenderer;
|
|
222
|
+
delete(world: World): void;
|
|
223
|
+
/** {@link Disposable.dispose} */
|
|
224
|
+
dispose(): void;
|
|
583
225
|
}
|
|
584
226
|
import * as THREE from "three";
|
|
585
227
|
import { Component, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
@@ -590,15 +232,14 @@ import { Components } from "../Components";
|
|
|
590
232
|
* [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes).
|
|
591
233
|
*
|
|
592
234
|
* @param components - the instance of {@link Components} used.
|
|
593
|
-
* @param planeType - the type of plane to be used by the clipper.
|
|
594
235
|
* E.g. {@link SimplePlane}.
|
|
595
236
|
*/
|
|
596
|
-
export declare class Clipper
|
|
237
|
+
export declare class Clipper extends Component implements Createable, Disposable, Hideable {
|
|
597
238
|
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
598
239
|
/** {@link Createable.onAfterCreate} */
|
|
599
|
-
readonly onAfterCreate: Event<
|
|
240
|
+
readonly onAfterCreate: Event<SimplePlane>;
|
|
600
241
|
/** {@link Createable.onAfterDelete} */
|
|
601
|
-
readonly onAfterDelete: Event<
|
|
242
|
+
readonly onAfterDelete: Event<SimplePlane>;
|
|
602
243
|
/** Event that fires when the user starts dragging a clipping plane. */
|
|
603
244
|
readonly onBeforeDrag: Event<void>;
|
|
604
245
|
/** Event that fires when the user stops dragging a clipping plane. */
|
|
@@ -622,10 +263,10 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
622
263
|
* has to be 'true' for this to apply.
|
|
623
264
|
*/
|
|
624
265
|
toleranceOrthogonalY: number;
|
|
625
|
-
|
|
626
|
-
|
|
266
|
+
Type: new (...args: any) => SimplePlane;
|
|
267
|
+
list: SimplePlane[];
|
|
627
268
|
/** The material used in all the clipping planes. */
|
|
628
|
-
|
|
269
|
+
private _material;
|
|
629
270
|
private _size;
|
|
630
271
|
private _enabled;
|
|
631
272
|
private _visible;
|
|
@@ -646,8 +287,6 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
646
287
|
/** The size of the geometric representation of the clippings planes. */
|
|
647
288
|
set size(size: number);
|
|
648
289
|
constructor(components: Components);
|
|
649
|
-
endCreation(): void;
|
|
650
|
-
cancelCreation(): void;
|
|
651
290
|
/** {@link Disposable.dispose} */
|
|
652
291
|
dispose(): void;
|
|
653
292
|
/** {@link Createable.create} */
|
|
@@ -661,7 +300,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
661
300
|
* @param point - the position of the clipping plane.
|
|
662
301
|
* navigation.
|
|
663
302
|
*/
|
|
664
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3):
|
|
303
|
+
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
665
304
|
/**
|
|
666
305
|
* {@link Createable.delete}
|
|
667
306
|
*
|
|
@@ -669,7 +308,7 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
669
308
|
* @param plane - the plane to delete. If undefined, the first plane
|
|
670
309
|
* found under the cursor will be deleted.
|
|
671
310
|
*/
|
|
672
|
-
delete(world: World, plane?:
|
|
311
|
+
delete(world: World, plane?: SimplePlane): void;
|
|
673
312
|
/** Deletes all the existing clipping planes. */
|
|
674
313
|
deleteAll(): void;
|
|
675
314
|
private deletePlane;
|
|
@@ -679,23 +318,89 @@ export declare class Clipper<T extends SimplePlane> extends Component implements
|
|
|
679
318
|
private getWorldNormal;
|
|
680
319
|
private normalizePlaneDirectionY;
|
|
681
320
|
private newPlane;
|
|
682
|
-
protected newPlaneInstance(world: World, point: THREE.Vector3, normal: THREE.Vector3): T;
|
|
683
321
|
private updateMaterialsAndPlanes;
|
|
684
322
|
private _onStartDragging;
|
|
685
323
|
private _onEndDragging;
|
|
686
324
|
}
|
|
325
|
+
import { MiniMap } from "./src";
|
|
326
|
+
import { Component, Updateable, World, Event, Disposable } from "../Types";
|
|
327
|
+
import { Components } from "../Components";
|
|
328
|
+
export declare class MiniMaps extends Component implements Updateable, Disposable {
|
|
329
|
+
static readonly uuid: "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f";
|
|
330
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
331
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
332
|
+
readonly onDisposed: Event<unknown>;
|
|
333
|
+
enabled: boolean;
|
|
334
|
+
list: Map<string, MiniMap>;
|
|
335
|
+
constructor(components: Components);
|
|
336
|
+
create(world: World): MiniMap;
|
|
337
|
+
delete(id: string): void;
|
|
338
|
+
dispose(): void;
|
|
339
|
+
update(): void;
|
|
340
|
+
}
|
|
687
341
|
import * as THREE from "three";
|
|
688
|
-
import
|
|
689
|
-
import {
|
|
690
|
-
import {
|
|
342
|
+
import { Components } from "../Components";
|
|
343
|
+
import { SimpleCamera } from "..";
|
|
344
|
+
import { NavigationMode, NavModeID, ProjectionManager } from "./src";
|
|
691
345
|
/**
|
|
692
|
-
* A
|
|
693
|
-
*
|
|
346
|
+
* A flexible camera that uses
|
|
347
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
348
|
+
* easily control the camera in 2D and 3D. It supports multiple navigation
|
|
349
|
+
* modes, such as 2D floor plan navigation, first person and 3D orbit.
|
|
694
350
|
*/
|
|
695
|
-
export declare class
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
351
|
+
export declare class OrthoPerspectiveCamera extends SimpleCamera {
|
|
352
|
+
/**
|
|
353
|
+
* The current {@link NavigationMode}.
|
|
354
|
+
*/
|
|
355
|
+
_mode: NavigationMode | null;
|
|
356
|
+
readonly projection: ProjectionManager;
|
|
357
|
+
readonly threeOrtho: THREE.OrthographicCamera;
|
|
358
|
+
readonly threePersp: THREE.PerspectiveCamera;
|
|
359
|
+
protected readonly _userInputButtons: any;
|
|
360
|
+
protected readonly _frustumSize = 50;
|
|
361
|
+
protected readonly _navigationModes: Map<NavModeID, NavigationMode>;
|
|
362
|
+
private previousSize;
|
|
363
|
+
get mode(): NavigationMode;
|
|
364
|
+
constructor(components: Components);
|
|
365
|
+
/** {@link Disposable.dispose} */
|
|
366
|
+
dispose(): void;
|
|
367
|
+
/**
|
|
368
|
+
* Sets a new {@link NavigationMode} and disables the previous one.
|
|
369
|
+
*
|
|
370
|
+
* @param mode - The {@link NavigationMode} to set.
|
|
371
|
+
*/
|
|
372
|
+
set(mode: NavModeID): void;
|
|
373
|
+
/**
|
|
374
|
+
* Make the camera view fit all the specified meshes.
|
|
375
|
+
*
|
|
376
|
+
* @param meshes the meshes to fit. If it is not defined, it will
|
|
377
|
+
* evaluate {@link Components.meshes}.
|
|
378
|
+
* @param offset the distance to the fit object
|
|
379
|
+
*/
|
|
380
|
+
fit(meshes: Iterable<THREE.Mesh>, offset?: number): Promise<void>;
|
|
381
|
+
/**
|
|
382
|
+
* Allows or prevents all user input.
|
|
383
|
+
*
|
|
384
|
+
* @param active - whether to enable or disable user inputs.
|
|
385
|
+
*/
|
|
386
|
+
setUserInput(active: boolean): void;
|
|
387
|
+
private disableUserInput;
|
|
388
|
+
private enableUserInput;
|
|
389
|
+
private newOrthoCamera;
|
|
390
|
+
private setOrthoPerspCameraAspect;
|
|
391
|
+
}
|
|
392
|
+
import * as THREE from "three";
|
|
393
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
394
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
395
|
+
import { Component, Components, Disposable, Event } from "../../core";
|
|
396
|
+
/**
|
|
397
|
+
* A simple implementation of bounding box that works for fragments. The resulting bbox is not 100% precise, but
|
|
398
|
+
* it's fast, and should suffice for general use cases such as camera zooming or general boundary determination.
|
|
399
|
+
*/
|
|
400
|
+
export declare class BoundingBoxer extends Component implements Disposable {
|
|
401
|
+
static readonly uuid: "d1444724-dba6-4cdd-a0c7-68ee1450d166";
|
|
402
|
+
/** {@link Component.enabled} */
|
|
403
|
+
enabled: boolean;
|
|
699
404
|
/** {@link Disposable.onDisposed} */
|
|
700
405
|
readonly onDisposed: Event<unknown>;
|
|
701
406
|
private _absoluteMin;
|
|
@@ -721,26 +426,6 @@ export declare class BoundingBoxes extends Component implements Disposable {
|
|
|
721
426
|
private static getFragmentBounds;
|
|
722
427
|
}
|
|
723
428
|
import * as THREE from "three";
|
|
724
|
-
export interface MeasureEdge {
|
|
725
|
-
distance: number;
|
|
726
|
-
points: THREE.Vector3[];
|
|
727
|
-
}
|
|
728
|
-
export declare class MeasurementUtils {
|
|
729
|
-
static getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
730
|
-
edges: MeasureEdge[];
|
|
731
|
-
indices: Set<number>;
|
|
732
|
-
} | null;
|
|
733
|
-
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
734
|
-
private static getFaceData;
|
|
735
|
-
static getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
736
|
-
p1: THREE.Vector3;
|
|
737
|
-
p2: THREE.Vector3;
|
|
738
|
-
p3: THREE.Vector3;
|
|
739
|
-
faceNormal: THREE.Vector3;
|
|
740
|
-
};
|
|
741
|
-
private static round;
|
|
742
|
-
}
|
|
743
|
-
import * as THREE from "three";
|
|
744
429
|
import * as FRAGS from "@thatopen/fragments";
|
|
745
430
|
import { Disposable, Component, Event, Components } from "../../core";
|
|
746
431
|
export interface Classification {
|
|
@@ -748,7 +433,7 @@ export interface Classification {
|
|
|
748
433
|
[className: string]: FRAGS.FragmentIdMap;
|
|
749
434
|
};
|
|
750
435
|
}
|
|
751
|
-
export declare class
|
|
436
|
+
export declare class Classifier extends Component implements Disposable {
|
|
752
437
|
static readonly uuid: "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7";
|
|
753
438
|
/** {@link Component.enabled} */
|
|
754
439
|
enabled: boolean;
|
|
@@ -772,19 +457,48 @@ export declare class FragmentClassifier extends Component implements Disposable
|
|
|
772
457
|
private saveItem;
|
|
773
458
|
}
|
|
774
459
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
775
|
-
export declare class
|
|
460
|
+
export declare class Exploder extends Component implements Disposable {
|
|
776
461
|
static readonly uuid: "d260618b-ce88-4c7d-826c-6debb91de3e2";
|
|
777
462
|
enabled: boolean;
|
|
778
463
|
height: number;
|
|
779
464
|
groupName: string;
|
|
780
465
|
/** {@link Disposable.onDisposed} */
|
|
781
|
-
readonly onDisposed: Event<
|
|
466
|
+
readonly onDisposed: Event<unknown>;
|
|
782
467
|
list: Set<string>;
|
|
783
468
|
constructor(components: Components);
|
|
784
469
|
dispose(): void;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
470
|
+
set(active: boolean): void;
|
|
471
|
+
}
|
|
472
|
+
import * as WEBIFC from "web-ifc";
|
|
473
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
474
|
+
import { IfcFragmentSettings } from "./src";
|
|
475
|
+
import { Component, Components, Event, Disposable } from "../../core";
|
|
476
|
+
export declare class IfcLoader extends Component implements Disposable {
|
|
477
|
+
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
478
|
+
readonly onIfcStartedLoading: Event<void>;
|
|
479
|
+
readonly onSetup: Event<void>;
|
|
480
|
+
/** {@link Disposable.onDisposed} */
|
|
481
|
+
readonly onDisposed: Event<string>;
|
|
482
|
+
settings: IfcFragmentSettings;
|
|
483
|
+
enabled: boolean;
|
|
484
|
+
webIfc: WEBIFC.IfcAPI;
|
|
485
|
+
private _material;
|
|
486
|
+
private _spatialTree;
|
|
487
|
+
private _metaData;
|
|
488
|
+
private _fragmentInstances;
|
|
489
|
+
private _civil;
|
|
490
|
+
private _visitedFragments;
|
|
491
|
+
private _materialT;
|
|
492
|
+
constructor(components: Components);
|
|
493
|
+
dispose(): void;
|
|
494
|
+
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
495
|
+
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
496
|
+
readIfcFile(data: Uint8Array): Promise<number>;
|
|
497
|
+
private getAllGeometries;
|
|
498
|
+
cleanUp(): void;
|
|
499
|
+
private getMesh;
|
|
500
|
+
private getGeometry;
|
|
501
|
+
private autoSetWasm;
|
|
788
502
|
}
|
|
789
503
|
import * as FRAGS from "@thatopen/fragments";
|
|
790
504
|
import { Components, Component } from "../../core";
|
|
@@ -796,21 +510,16 @@ export declare class FragmentHider extends Component {
|
|
|
796
510
|
isolate(items: FRAGS.FragmentIdMap): void;
|
|
797
511
|
private updateCulledVisibility;
|
|
798
512
|
}
|
|
799
|
-
import * as WEBIFC from "web-ifc";
|
|
800
|
-
export interface IfcItemsCategories {
|
|
801
|
-
[itemID: number]: number;
|
|
802
|
-
}
|
|
803
|
-
export declare class IfcCategories {
|
|
804
|
-
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
805
|
-
}
|
|
806
513
|
import { Fragment, FragmentsGroup } from "@thatopen/fragments";
|
|
807
514
|
import * as THREE from "three";
|
|
515
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
808
516
|
import { Component, Components, Event, Disposable } from "../../core";
|
|
517
|
+
import { RelationsMap } from "../../ifc/IfcRelationsIndexer/src/types";
|
|
809
518
|
/**
|
|
810
519
|
* Object that can efficiently load binary files that contain
|
|
811
520
|
* [fragment geometry](https://github.com/ThatOpen/engine_fragment).
|
|
812
521
|
*/
|
|
813
|
-
export declare class
|
|
522
|
+
export declare class FragmentsManager extends Component implements Disposable {
|
|
814
523
|
static readonly uuid: "fef46874-46a3-461b-8c44-2922ab77c806";
|
|
815
524
|
/** {@link Disposable.onDisposed} */
|
|
816
525
|
readonly onDisposed: Event<unknown>;
|
|
@@ -833,12 +542,18 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
833
542
|
dispose(): void;
|
|
834
543
|
disposeGroup(group: FragmentsGroup): void;
|
|
835
544
|
/**
|
|
836
|
-
* Loads
|
|
837
|
-
* @param data -
|
|
838
|
-
* @param
|
|
839
|
-
* @
|
|
545
|
+
* Loads a binar file that contain fragment geometry.
|
|
546
|
+
* @param data - The binary data to load.
|
|
547
|
+
* @param config - Optional configuration for loading.
|
|
548
|
+
* @param config.coordinate - Whether to apply coordinate transformation. Default is true.
|
|
549
|
+
* @param config.properties - Ifc properties to set on the loaded fragments. Not to be used when streaming.
|
|
550
|
+
* @returns The loaded FragmentsGroup.
|
|
840
551
|
*/
|
|
841
|
-
load(data: Uint8Array,
|
|
552
|
+
load(data: Uint8Array, config?: Partial<{
|
|
553
|
+
coordinate: boolean;
|
|
554
|
+
properties: FRAGS.IfcProperties;
|
|
555
|
+
relationsMap: RelationsMap;
|
|
556
|
+
}>): FragmentsGroup;
|
|
842
557
|
/**
|
|
843
558
|
* Export the specified fragments.
|
|
844
559
|
* @param group - the fragments group to be exported.
|
|
@@ -847,70 +562,6 @@ export declare class FragmentManager extends Component implements Disposable {
|
|
|
847
562
|
export(group: FragmentsGroup): Uint8Array;
|
|
848
563
|
coordinate(models?: FragmentsGroup[]): void;
|
|
849
564
|
}
|
|
850
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
851
|
-
export declare class IfcPropertiesUtils {
|
|
852
|
-
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
853
|
-
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
854
|
-
[attribute: string]: any;
|
|
855
|
-
} | null>;
|
|
856
|
-
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
857
|
-
[relatingID: number]: number[];
|
|
858
|
-
}>;
|
|
859
|
-
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
860
|
-
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
861
|
-
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
862
|
-
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
863
|
-
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
864
|
-
key: string | null;
|
|
865
|
-
name: string | null;
|
|
866
|
-
}>;
|
|
867
|
-
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
868
|
-
key: string | null;
|
|
869
|
-
value: number | null;
|
|
870
|
-
}>;
|
|
871
|
-
static isRel(expressID: number): boolean;
|
|
872
|
-
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
873
|
-
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
874
|
-
}
|
|
875
|
-
import * as WEBIFC from "web-ifc";
|
|
876
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
877
|
-
import { IfcFragmentSettings } from "./src";
|
|
878
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
879
|
-
export declare class FragmentIfcLoader extends Component implements Disposable {
|
|
880
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
881
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
882
|
-
readonly onSetup: Event<void>;
|
|
883
|
-
/** {@link Disposable.onDisposed} */
|
|
884
|
-
readonly onDisposed: Event<string>;
|
|
885
|
-
settings: IfcFragmentSettings;
|
|
886
|
-
enabled: boolean;
|
|
887
|
-
webIfc: WEBIFC.IfcAPI;
|
|
888
|
-
private _material;
|
|
889
|
-
private _spatialTree;
|
|
890
|
-
private _metaData;
|
|
891
|
-
private _fragmentInstances;
|
|
892
|
-
private _civil;
|
|
893
|
-
private _propertyExporter;
|
|
894
|
-
private _visitedFragments;
|
|
895
|
-
private _materialT;
|
|
896
|
-
constructor(components: Components);
|
|
897
|
-
dispose(): void;
|
|
898
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
899
|
-
load(data: Uint8Array, coordinate?: boolean): Promise<FRAGS.FragmentsGroup>;
|
|
900
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
901
|
-
private getAllGeometries;
|
|
902
|
-
cleanUp(): void;
|
|
903
|
-
private getMesh;
|
|
904
|
-
private getGeometry;
|
|
905
|
-
private autoSetWasm;
|
|
906
|
-
}
|
|
907
|
-
export declare const IfcCategoryMap: {
|
|
908
|
-
[key: number]: string;
|
|
909
|
-
};
|
|
910
|
-
export declare const IfcElements: {
|
|
911
|
-
[key: number]: string;
|
|
912
|
-
};
|
|
913
|
-
export declare const GeometryTypes: Set<number>;
|
|
914
565
|
import * as WEBIFC from "web-ifc";
|
|
915
566
|
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
916
567
|
import { PropertiesStreamingSettings } from "../IfcGeometryTiler";
|
|
@@ -978,235 +629,381 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
|
978
629
|
private streamGeometries;
|
|
979
630
|
}
|
|
980
631
|
import * as THREE from "three";
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
renderer: THREE.WebGLRenderer;
|
|
992
|
-
enabled: boolean;
|
|
993
|
-
world: World;
|
|
994
|
-
private _lockRotation;
|
|
995
|
-
private _camera;
|
|
996
|
-
private _plane;
|
|
997
|
-
private _size;
|
|
998
|
-
private _tempVector1;
|
|
999
|
-
private _tempVector2;
|
|
1000
|
-
private _tempTarget;
|
|
1001
|
-
private readonly down;
|
|
1002
|
-
get lockRotation(): boolean;
|
|
1003
|
-
set lockRotation(active: boolean);
|
|
1004
|
-
get zoom(): number;
|
|
1005
|
-
set zoom(value: number);
|
|
1006
|
-
constructor(world: World);
|
|
1007
|
-
dispose(): void;
|
|
1008
|
-
get(): THREE.OrthographicCamera;
|
|
1009
|
-
update(): void;
|
|
1010
|
-
getSize(): THREE.Vector2;
|
|
1011
|
-
resize(size?: THREE.Vector2): void;
|
|
1012
|
-
private updatePlanes;
|
|
632
|
+
export declare function obbFromPoints(vertices: ArrayLike<number>): {
|
|
633
|
+
center: THREE.Vector3;
|
|
634
|
+
halfSizes: THREE.Vector3;
|
|
635
|
+
rotation: THREE.Matrix3;
|
|
636
|
+
transformation: THREE.Matrix4;
|
|
637
|
+
};
|
|
638
|
+
export declare function isPointInFrontOfPlane(point: number[], planePoint: number[], planeNormal: number[]): boolean;
|
|
639
|
+
import * as THREE from "three";
|
|
640
|
+
export declare class MaterialsUtils {
|
|
641
|
+
static isTransparent(material: THREE.Material): boolean;
|
|
1013
642
|
}
|
|
1014
643
|
import * as THREE from "three";
|
|
1015
|
-
import {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1022
|
-
readonly onAfterUpdate: Event<unknown>;
|
|
1023
|
-
readonly onBeforeUpdate: Event<unknown>;
|
|
644
|
+
import { Component, Components } from "../../core";
|
|
645
|
+
export interface MeasureEdge {
|
|
646
|
+
distance: number;
|
|
647
|
+
points: THREE.Vector3[];
|
|
648
|
+
}
|
|
649
|
+
export declare class MeasurementUtils extends Component {
|
|
1024
650
|
enabled: boolean;
|
|
1025
|
-
uuid: string;
|
|
1026
|
-
readonly onDisposed: Event<unknown>;
|
|
1027
|
-
private _scene?;
|
|
1028
|
-
private _camera?;
|
|
1029
|
-
private _renderer;
|
|
1030
|
-
get scene(): T;
|
|
1031
|
-
set scene(scene: T);
|
|
1032
|
-
get camera(): U;
|
|
1033
|
-
set camera(camera: U);
|
|
1034
|
-
get renderer(): S | null;
|
|
1035
|
-
set renderer(renderer: S | null);
|
|
651
|
+
static uuid: string;
|
|
1036
652
|
constructor(components: Components);
|
|
1037
|
-
|
|
1038
|
-
|
|
653
|
+
getFace(mesh: THREE.InstancedMesh | THREE.Mesh, triangleIndex: number, instance?: number): {
|
|
654
|
+
edges: MeasureEdge[];
|
|
655
|
+
indices: Set<number>;
|
|
656
|
+
} | null;
|
|
657
|
+
static distanceFromPointToLine(point: THREE.Vector3, lineStart: THREE.Vector3, lineEnd: THREE.Vector3, clamp?: boolean): number;
|
|
658
|
+
private getFaceData;
|
|
659
|
+
getVerticesAndNormal(mesh: THREE.Mesh | THREE.InstancedMesh, faceIndex: number, instance: number | undefined): {
|
|
660
|
+
p1: THREE.Vector3;
|
|
661
|
+
p2: THREE.Vector3;
|
|
662
|
+
p3: THREE.Vector3;
|
|
663
|
+
faceNormal: THREE.Vector3;
|
|
664
|
+
};
|
|
665
|
+
private round;
|
|
666
|
+
}
|
|
667
|
+
export declare class UUID {
|
|
668
|
+
private static _pattern;
|
|
669
|
+
private static _lut;
|
|
670
|
+
static create(): string;
|
|
671
|
+
static validate(uuid: string): void;
|
|
1039
672
|
}
|
|
1040
673
|
import * as THREE from "three";
|
|
1041
|
-
import {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
*/
|
|
1047
|
-
export declare class SimpleRenderer extends BaseRenderer {
|
|
1048
|
-
enabled: boolean;
|
|
1049
|
-
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1050
|
-
container: HTMLElement;
|
|
1051
|
-
three: THREE.WebGLRenderer;
|
|
1052
|
-
protected _canvas: HTMLCanvasElement;
|
|
1053
|
-
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1054
|
-
protected _resizeObserver: ResizeObserver | null;
|
|
1055
|
-
protected onContainerUpdated: Event<HTMLElement>;
|
|
1056
|
-
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1057
|
-
/** {@link Updateable.update} */
|
|
1058
|
-
update(): void;
|
|
1059
|
-
/** {@link Disposable.dispose} */
|
|
1060
|
-
dispose(): void;
|
|
1061
|
-
/** {@link Resizeable.getSize}. */
|
|
1062
|
-
getSize(): THREE.Vector2;
|
|
1063
|
-
/** {@link Resizeable.resize} */
|
|
1064
|
-
resize: (size?: THREE.Vector2) => void;
|
|
1065
|
-
setupEvents(active: boolean): void;
|
|
1066
|
-
private resizeEvent;
|
|
1067
|
-
private setupRenderer;
|
|
1068
|
-
private onContextLost;
|
|
1069
|
-
private onContextBack;
|
|
674
|
+
import { Component, Components, Event, World } from "../core";
|
|
675
|
+
export interface VertexPickerConfig {
|
|
676
|
+
showOnlyVertex: boolean;
|
|
677
|
+
snapDistance: number;
|
|
678
|
+
previewElement: HTMLElement;
|
|
1070
679
|
}
|
|
1071
|
-
export declare
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
680
|
+
export declare class VertexPicker extends Component {
|
|
681
|
+
onVertexFound: Event<THREE.Vector3>;
|
|
682
|
+
onVertexLost: Event<THREE.Vector3>;
|
|
683
|
+
components: Components;
|
|
684
|
+
private _pickedPoint;
|
|
685
|
+
private _config;
|
|
686
|
+
private _enabled;
|
|
687
|
+
private _workingPlane;
|
|
688
|
+
set enabled(value: boolean);
|
|
689
|
+
get enabled(): boolean;
|
|
690
|
+
constructor(components: Components, config?: Partial<VertexPickerConfig>);
|
|
691
|
+
set workingPlane(plane: THREE.Plane | null);
|
|
692
|
+
get workingPlane(): THREE.Plane | null;
|
|
693
|
+
set config(value: Partial<VertexPickerConfig>);
|
|
694
|
+
get config(): Partial<VertexPickerConfig>;
|
|
695
|
+
dispose(): void;
|
|
696
|
+
get(world: World): THREE.Vector3 | null;
|
|
697
|
+
private getClosestVertex;
|
|
698
|
+
private getVertices;
|
|
699
|
+
private getVertex;
|
|
1087
700
|
}
|
|
701
|
+
import * as WEBIFC from "web-ifc";
|
|
702
|
+
import * as FRAG from "@thatopen/fragments";
|
|
703
|
+
import { Component, Components } from "../../core";
|
|
1088
704
|
/**
|
|
1089
|
-
*
|
|
1090
|
-
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1091
|
-
* @noInheritDoc
|
|
705
|
+
* Object to export all the properties from an IFC to a JS object.
|
|
1092
706
|
*/
|
|
1093
|
-
export declare class
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
/** {@link Configurable.onSetup} */
|
|
1098
|
-
readonly onSetup: Event<SimpleScene>;
|
|
1099
|
-
config: Required<SimpleSceneConfig>;
|
|
707
|
+
export declare class IfcJsonExporter extends Component {
|
|
708
|
+
static readonly uuid: "b32c4332-cd67-436e-ba7f-196646c7a635";
|
|
709
|
+
/** {@link Component.enabled} */
|
|
710
|
+
enabled: boolean;
|
|
1100
711
|
constructor(components: Components);
|
|
1101
|
-
/**
|
|
1102
|
-
|
|
712
|
+
/**
|
|
713
|
+
* Exports all the properties of an IFC into an array of JS objects.
|
|
714
|
+
* @param webIfc The instance of [web-ifc]{@link https://github.com/ThatOpen/engine_web-ifc} to use.
|
|
715
|
+
* @param modelID ID of the IFC model whose properties to extract.
|
|
716
|
+
* @param indirect whether to get the indirect relationships as well.
|
|
717
|
+
* @param recursiveSpatial whether to get the properties of spatial items recursively
|
|
718
|
+
* to make the location data available (e.g. absolute position of building).
|
|
719
|
+
*/
|
|
720
|
+
export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
|
|
1103
721
|
}
|
|
1104
722
|
import * as WEBIFC from "web-ifc";
|
|
1105
|
-
import {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
private _units;
|
|
1109
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
1110
|
-
cleanUp(): void;
|
|
1111
|
-
}
|
|
1112
|
-
import * as THREE from "three";
|
|
1113
|
-
import CameraControls from "camera-controls";
|
|
1114
|
-
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1115
|
-
import { Components } from "../../Components";
|
|
723
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
724
|
+
import { Disposable, Event, Component, Components } from "../../core";
|
|
725
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src/types";
|
|
1116
726
|
/**
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1120
|
-
* what features it offers.
|
|
727
|
+
* Indexer for IFC entities, facilitating the indexing and retrieval of IFC entity relationships.
|
|
728
|
+
* It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations.
|
|
1121
729
|
*/
|
|
1122
|
-
export declare class
|
|
1123
|
-
|
|
1124
|
-
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1125
|
-
/** {@link Updateable.onAfterUpdate} */
|
|
1126
|
-
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1127
|
-
readonly onAspectUpdated: Event<unknown>;
|
|
730
|
+
export declare class IfcRelationsIndexer extends Component implements Disposable {
|
|
731
|
+
static readonly uuid: "23a889ab-83b3-44a4-8bee-ead83438370b";
|
|
1128
732
|
/** {@link Disposable.onDisposed} */
|
|
1129
733
|
readonly onDisposed: Event<string>;
|
|
1130
|
-
|
|
1131
|
-
|
|
734
|
+
enabled: boolean;
|
|
735
|
+
readonly onRelationsIndexed: Event<{
|
|
736
|
+
modelID: string;
|
|
737
|
+
relationsMap: RelationsMap;
|
|
738
|
+
}>;
|
|
739
|
+
private _relToAttributesMap;
|
|
740
|
+
private _inverseAttributes;
|
|
741
|
+
private _ifcRels;
|
|
1132
742
|
/**
|
|
1133
|
-
*
|
|
1134
|
-
*
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
743
|
+
* Holds the relationship mappings for each model processed by the indexer.
|
|
744
|
+
* The structure is a map where each key is a model's UUID, and the value is another map.
|
|
745
|
+
* This inner map's keys are entity expressIDs, and its values are maps where each key is an index
|
|
746
|
+
* representing a specific relation type, and the value is an array of expressIDs of entities
|
|
747
|
+
* that are related through that relation type. This structure allows for efficient querying
|
|
748
|
+
* of entity relationships within a model.
|
|
1137
749
|
*/
|
|
1138
|
-
|
|
1139
|
-
/** {@link Component.enabled} */
|
|
1140
|
-
get enabled(): boolean;
|
|
1141
|
-
/** {@link Component.enabled} */
|
|
1142
|
-
set enabled(enabled: boolean);
|
|
750
|
+
readonly relationMaps: ModelsRelationMap;
|
|
1143
751
|
constructor(components: Components);
|
|
1144
|
-
|
|
1145
|
-
dispose(): void;
|
|
1146
|
-
/** {@link Updateable.update} */
|
|
1147
|
-
update(_delta: number): void;
|
|
752
|
+
private onFragmentsDisposed;
|
|
1148
753
|
/**
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
754
|
+
* Adds a relation map to the model's relations map.
|
|
755
|
+
*
|
|
756
|
+
* @param model - The 'FragmentsGroup' model to which the relation map will be added.
|
|
757
|
+
* @param relationMap - The 'RelationsMap' to be added to the model's relations map.
|
|
758
|
+
*
|
|
759
|
+
* @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
|
|
1151
760
|
*/
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
761
|
+
setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
|
|
762
|
+
/**
|
|
763
|
+
* Processes a given model to index its IFC entities relations based on predefined inverse attributes.
|
|
764
|
+
* This method iterates through each specified inverse attribute, retrieves the corresponding relations,
|
|
765
|
+
* and maps them in a structured way to facilitate quick access to related entities.
|
|
766
|
+
*
|
|
767
|
+
* The process involves querying the model for each relation type associated with the inverse attributes
|
|
768
|
+
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
|
|
769
|
+
* and contains a nested map where each key is an entity's expressID and its value is another map.
|
|
770
|
+
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
|
|
771
|
+
* of entities that are related through that attribute.
|
|
772
|
+
*
|
|
773
|
+
* @param model The 'FragmentsGroup' model to be processed. It must have properties loaded.
|
|
774
|
+
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed
|
|
775
|
+
* representation of the relations indexed by entity expressIDs and relation types.
|
|
776
|
+
* @throws An error if the model does not have properties loaded.
|
|
777
|
+
*/
|
|
778
|
+
process(model: FragmentsGroup): Promise<RelationsMap>;
|
|
779
|
+
/**
|
|
780
|
+
* Processes a given model from a WebIfc API to index its IFC entities relations.
|
|
781
|
+
*
|
|
782
|
+
* @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
|
|
783
|
+
* @param modelID - The unique identifier of the model within the WebIfc API.
|
|
784
|
+
* @returns A promise that resolves to the relations map for the processed model.
|
|
785
|
+
* This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
|
|
786
|
+
*/
|
|
787
|
+
processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
|
|
788
|
+
/**
|
|
789
|
+
* Retrieves the relations of a specific entity within a model based on the given relation name.
|
|
790
|
+
* This method searches the indexed relation maps for the specified model and entity,
|
|
791
|
+
* returning the IDs of related entities if a match is found.
|
|
792
|
+
*
|
|
793
|
+
* @param model The 'FragmentsGroup' model containing the entity.
|
|
794
|
+
* @param expressID The unique identifier of the entity within the model.
|
|
795
|
+
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
796
|
+
* @returns An array of express IDs representing the related entities, or 'null' if no relations are found
|
|
797
|
+
* or the specified relation name is not indexed.
|
|
798
|
+
*/
|
|
799
|
+
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute): number[] | null;
|
|
800
|
+
/**
|
|
801
|
+
* Serializes the relations of a given relation map into a JSON string.
|
|
802
|
+
* This method iterates through the relations in the given map, organizing them into a structured object where each key is an expressID of an entity,
|
|
803
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
804
|
+
* The resulting object is then serialized into a JSON string.
|
|
805
|
+
*
|
|
806
|
+
* @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.
|
|
807
|
+
* @returns A JSON string representing the serialized relations of the given relation map.
|
|
808
|
+
*/
|
|
809
|
+
serializeRelations(relationMap: RelationsMap): string;
|
|
810
|
+
/**
|
|
811
|
+
* Serializes the relations of a specific model into a JSON string.
|
|
812
|
+
* This method iterates through the relations indexed for the given model,
|
|
813
|
+
* organizing them into a structured object where each key is an expressID of an entity,
|
|
814
|
+
* and its value is another object mapping relation indices to arrays of related entity expressIDs.
|
|
815
|
+
* The resulting object is then serialized into a JSON string.
|
|
816
|
+
*
|
|
817
|
+
* @param model The 'FragmentsGroup' model whose relations are to be serialized.
|
|
818
|
+
* @returns A JSON string representing the serialized relations of the specified model.
|
|
819
|
+
* If the model has no indexed relations, 'null' is returned.
|
|
820
|
+
*/
|
|
821
|
+
serializeModelRelations(model: FragmentsGroup): string | null;
|
|
822
|
+
/**
|
|
823
|
+
* Serializes all relations of every model processed by the indexer into a JSON string.
|
|
824
|
+
* This method iterates through each model's relations indexed in 'relationMaps', organizing them
|
|
825
|
+
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
|
|
826
|
+
* and its value is another object mapping entity expressIDs to their related entities, categorized
|
|
827
|
+
* by relation types. The structure facilitates easy access to any entity's relations across all models.
|
|
828
|
+
*
|
|
829
|
+
* @returns A JSON string representing the serialized relations of all models processed by the indexer.
|
|
830
|
+
* If no relations have been indexed, an empty object is returned as a JSON string.
|
|
831
|
+
*/
|
|
832
|
+
serializeAllRelations(): string;
|
|
833
|
+
/**
|
|
834
|
+
* Converts a JSON string representing relations between entities into a structured map.
|
|
835
|
+
* This method parses the JSON string to reconstruct the relations map that indexes
|
|
836
|
+
* entity relations by their express IDs. The outer map keys are the express IDs of entities,
|
|
837
|
+
* and the values are maps where each key is a relation type ID and its value is an array
|
|
838
|
+
* of express IDs of entities related through that relation type.
|
|
839
|
+
*
|
|
840
|
+
* @param json The JSON string to be parsed into the relations map.
|
|
841
|
+
* @returns A 'Map' where the key is the express ID of an entity as a number, and the value
|
|
842
|
+
* is another 'Map'. This inner map's key is the relation type ID as a number, and its value
|
|
843
|
+
* is an array of express IDs (as numbers) of entities related through that relation type.
|
|
844
|
+
*/
|
|
845
|
+
getRelationsMapFromJSON(json: string): RelationsMap;
|
|
846
|
+
/**
|
|
847
|
+
* Disposes the component, cleaning up resources and detaching event listeners.
|
|
848
|
+
* This ensures that the component is properly cleaned up and does not leave behind any
|
|
849
|
+
* references that could prevent garbage collection.
|
|
850
|
+
*/
|
|
851
|
+
dispose(): void;
|
|
1157
852
|
}
|
|
1158
|
-
|
|
1159
|
-
import * as
|
|
1160
|
-
import {
|
|
1161
|
-
import { Components } from "../../
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
853
|
+
export type { InverseAttribute } from "./src/types";
|
|
854
|
+
import * as WEBIFC from "web-ifc";
|
|
855
|
+
import { FragmentsGroup } from "@thatopen/fragments";
|
|
856
|
+
import { Component, Disposable, Event, Components } from "../../core";
|
|
857
|
+
type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
|
|
858
|
+
type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
|
|
859
|
+
type NumericPropTypes = "IfcInteger" | "IfcReal";
|
|
860
|
+
interface ChangeMap {
|
|
861
|
+
[modelID: string]: Set<number>;
|
|
1167
862
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
863
|
+
interface AttributeListener {
|
|
864
|
+
[modelID: string]: {
|
|
865
|
+
[expressID: number]: {
|
|
866
|
+
[attributeName: string]: Event<String | Boolean | Number>;
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
export declare class IfcPropertiesManager extends Component implements Disposable {
|
|
871
|
+
static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
|
|
872
|
+
/** {@link Disposable.onDisposed} */
|
|
873
|
+
readonly onDisposed: Event<string>;
|
|
874
|
+
readonly onRequestFile: Event<unknown>;
|
|
875
|
+
ifcToExport: ArrayBuffer | null;
|
|
876
|
+
readonly onElementToPset: Event<{
|
|
877
|
+
model: FragmentsGroup;
|
|
878
|
+
psetID: number;
|
|
879
|
+
elementID: number;
|
|
880
|
+
}>;
|
|
881
|
+
readonly onPropToPset: Event<{
|
|
882
|
+
model: FragmentsGroup;
|
|
883
|
+
psetID: number;
|
|
884
|
+
propID: number;
|
|
885
|
+
}>;
|
|
886
|
+
readonly onPsetRemoved: Event<{
|
|
887
|
+
model: FragmentsGroup;
|
|
888
|
+
psetID: number;
|
|
889
|
+
}>;
|
|
890
|
+
readonly onDataChanged: Event<{
|
|
891
|
+
model: FragmentsGroup;
|
|
892
|
+
expressID: number;
|
|
893
|
+
}>;
|
|
894
|
+
wasm: {
|
|
895
|
+
path: string;
|
|
896
|
+
absolute: boolean;
|
|
897
|
+
};
|
|
898
|
+
enabled: boolean;
|
|
899
|
+
attributeListeners: AttributeListener;
|
|
900
|
+
selectedModel?: FragmentsGroup;
|
|
901
|
+
changeMap: ChangeMap;
|
|
902
|
+
constructor(components: Components);
|
|
903
|
+
dispose(): void;
|
|
904
|
+
private increaseMaxID;
|
|
905
|
+
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
906
|
+
private newGUID;
|
|
907
|
+
private getOwnerHistory;
|
|
908
|
+
private registerChange;
|
|
909
|
+
setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
|
|
910
|
+
newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
|
|
911
|
+
pset: WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
|
|
912
|
+
rel: WEBIFC.IFC4X3.IfcRelDefinesByProperties | WEBIFC.IFC4.IfcRelDefinesByProperties | WEBIFC.IFC2X3.IfcRelDefinesByProperties;
|
|
913
|
+
}>;
|
|
914
|
+
removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
|
|
915
|
+
private newSingleProperty;
|
|
916
|
+
newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
917
|
+
newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
918
|
+
newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
|
|
919
|
+
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
920
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...elementID: number[]): Promise<void>;
|
|
921
|
+
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
922
|
+
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
923
|
+
setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
|
|
924
|
+
}
|
|
925
|
+
export {};
|
|
926
|
+
import * as WEBIFC from "web-ifc";
|
|
927
|
+
import { IfcItemsCategories } from "../../../ifc";
|
|
928
|
+
export declare class SpatialStructure {
|
|
929
|
+
itemsByFloor: IfcItemsCategories;
|
|
930
|
+
private _units;
|
|
931
|
+
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
932
|
+
cleanUp(): void;
|
|
933
|
+
}
|
|
934
|
+
import * as THREE from "three";
|
|
935
|
+
import { Resizeable, Updateable, World, Event, Disposable } from "../../Types";
|
|
936
|
+
export declare class MiniMap implements Resizeable, Updateable, Disposable {
|
|
1175
937
|
/** {@link Disposable.onDisposed} */
|
|
1176
938
|
readonly onDisposed: Event<unknown>;
|
|
939
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
940
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
941
|
+
readonly onResize: Event<THREE.Vector2>;
|
|
942
|
+
frontOffset: number;
|
|
943
|
+
overrideMaterial: THREE.MeshDepthMaterial;
|
|
944
|
+
backgroundColor: THREE.Color;
|
|
945
|
+
renderer: THREE.WebGLRenderer;
|
|
946
|
+
enabled: boolean;
|
|
1177
947
|
world: World;
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1192
|
-
* perspective cameras and false for orthographic cameras.
|
|
1193
|
-
*/
|
|
1194
|
-
set fade(active: boolean);
|
|
1195
|
-
private readonly _grid;
|
|
1196
|
-
private _fade;
|
|
1197
|
-
constructor(components: Components, world: World, config: GridConfig);
|
|
1198
|
-
[Symbol.dispose](): void;
|
|
1199
|
-
/** {@link Component.get} */
|
|
1200
|
-
get(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
1201
|
-
/** {@link Disposable.dispose} */
|
|
948
|
+
private _lockRotation;
|
|
949
|
+
private _camera;
|
|
950
|
+
private _plane;
|
|
951
|
+
private _size;
|
|
952
|
+
private _tempVector1;
|
|
953
|
+
private _tempVector2;
|
|
954
|
+
private _tempTarget;
|
|
955
|
+
private readonly down;
|
|
956
|
+
get lockRotation(): boolean;
|
|
957
|
+
set lockRotation(active: boolean);
|
|
958
|
+
get zoom(): number;
|
|
959
|
+
set zoom(value: number);
|
|
960
|
+
constructor(world: World);
|
|
1202
961
|
dispose(): void;
|
|
1203
|
-
|
|
1204
|
-
|
|
962
|
+
get(): THREE.OrthographicCamera;
|
|
963
|
+
update(): void;
|
|
964
|
+
getSize(): THREE.Vector2;
|
|
965
|
+
resize(size?: THREE.Vector2): void;
|
|
966
|
+
private updatePlanes;
|
|
967
|
+
}
|
|
968
|
+
export declare const GeometryTypes: Set<number>;
|
|
969
|
+
import * as WEBIFC from "web-ifc";
|
|
970
|
+
export interface IfcItemsCategories {
|
|
971
|
+
[itemID: number]: number;
|
|
972
|
+
}
|
|
973
|
+
export declare class IfcCategories {
|
|
974
|
+
getAll(webIfc: WEBIFC.IfcAPI, modelID: number): IfcItemsCategories;
|
|
975
|
+
}
|
|
976
|
+
export declare const IfcElements: {
|
|
977
|
+
[key: number]: string;
|
|
978
|
+
};
|
|
979
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
980
|
+
export declare class IfcPropertiesUtils {
|
|
981
|
+
static getUnits(group: FRAGS.FragmentsGroup): Promise<number>;
|
|
982
|
+
static findItemByGuid(model: FRAGS.FragmentsGroup, guid: string): Promise<{
|
|
983
|
+
[attribute: string]: any;
|
|
984
|
+
} | null>;
|
|
985
|
+
static getRelationMap(model: FRAGS.FragmentsGroup, relationType: number, onElementsFound?: (relatingID: number, relatedIDs: number[]) => Promise<void>): Promise<{
|
|
986
|
+
[relatingID: number]: number[];
|
|
987
|
+
}>;
|
|
988
|
+
static getQsetQuantities(model: FRAGS.FragmentsGroup, expressID: number, onQuantityFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
989
|
+
static getPsetProps(model: FRAGS.FragmentsGroup, expressID: number, onPropFound?: (expressID: number) => void): Promise<number[] | null>;
|
|
990
|
+
static getPsetRel(model: FRAGS.FragmentsGroup, psetID: number): Promise<number | null>;
|
|
991
|
+
static getQsetRel(model: FRAGS.FragmentsGroup, qsetID: number): Promise<number | null>;
|
|
992
|
+
static getEntityName(model: FRAGS.FragmentsGroup, entityID: number): Promise<{
|
|
993
|
+
key: string | null;
|
|
994
|
+
name: string | null;
|
|
995
|
+
}>;
|
|
996
|
+
static getQuantityValue(model: FRAGS.FragmentsGroup, quantityID: number): Promise<{
|
|
997
|
+
key: string | null;
|
|
998
|
+
value: number | null;
|
|
999
|
+
}>;
|
|
1000
|
+
static isRel(expressID: number): boolean;
|
|
1001
|
+
static attributeExists(model: FRAGS.FragmentsGroup, expressID: number, attribute: string): Promise<boolean>;
|
|
1002
|
+
static groupEntitiesByType(model: FRAGS.FragmentsGroup, expressIDs: Set<number> | number[]): Promise<Map<number, Set<number>>>;
|
|
1205
1003
|
}
|
|
1206
|
-
export declare const
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
}>;
|
|
1004
|
+
export declare const IfcCategoryMap: {
|
|
1005
|
+
[key: number]: string;
|
|
1006
|
+
};
|
|
1210
1007
|
/**
|
|
1211
1008
|
* Simple event handler by
|
|
1212
1009
|
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540).
|
|
@@ -1275,6 +1072,11 @@ export declare class AsyncEvent<T> {
|
|
|
1275
1072
|
reset(): void;
|
|
1276
1073
|
private handlers;
|
|
1277
1074
|
}
|
|
1075
|
+
import { InverseAttribute } from "./types";
|
|
1076
|
+
export declare const relToAttributesMap: Map<number, {
|
|
1077
|
+
forRelating: InverseAttribute;
|
|
1078
|
+
forRelated: InverseAttribute;
|
|
1079
|
+
}>;
|
|
1278
1080
|
import * as THREE from "three";
|
|
1279
1081
|
import CameraControls from "camera-controls";
|
|
1280
1082
|
import { Event } from "./event";
|
|
@@ -1416,23 +1218,6 @@ export declare abstract class Component extends Base {
|
|
|
1416
1218
|
*/
|
|
1417
1219
|
abstract enabled: boolean;
|
|
1418
1220
|
}
|
|
1419
|
-
import { Base } from "./base";
|
|
1420
|
-
import { World } from "./world";
|
|
1421
|
-
import { Event } from "./event";
|
|
1422
|
-
import { Components } from "../../Components";
|
|
1423
|
-
/**
|
|
1424
|
-
* One of the elements that make a world. It can be either a scene, a camera
|
|
1425
|
-
* or a renderer.
|
|
1426
|
-
*/
|
|
1427
|
-
export declare abstract class BaseWorldItem extends Base {
|
|
1428
|
-
readonly worlds: Map<string, World>;
|
|
1429
|
-
readonly onWorldChanged: Event<{
|
|
1430
|
-
world: World;
|
|
1431
|
-
action: "added" | "removed";
|
|
1432
|
-
}>;
|
|
1433
|
-
currentWorld: World | null;
|
|
1434
|
-
protected constructor(components: Components);
|
|
1435
|
-
}
|
|
1436
1221
|
import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
|
|
1437
1222
|
import { Components } from "../../Components";
|
|
1438
1223
|
/**
|
|
@@ -1452,6 +1237,23 @@ export declare abstract class Base {
|
|
|
1452
1237
|
/** Whether is component is {@link Configurable}. */
|
|
1453
1238
|
isConfigurable: () => this is Configurable<any>;
|
|
1454
1239
|
}
|
|
1240
|
+
import { Base } from "./base";
|
|
1241
|
+
import { World } from "./world";
|
|
1242
|
+
import { Event } from "./event";
|
|
1243
|
+
import { Components } from "../../Components";
|
|
1244
|
+
/**
|
|
1245
|
+
* One of the elements that make a world. It can be either a scene, a camera
|
|
1246
|
+
* or a renderer.
|
|
1247
|
+
*/
|
|
1248
|
+
export declare abstract class BaseWorldItem extends Base {
|
|
1249
|
+
readonly worlds: Map<string, World>;
|
|
1250
|
+
readonly onWorldChanged: Event<{
|
|
1251
|
+
world: World;
|
|
1252
|
+
action: "added" | "removed";
|
|
1253
|
+
}>;
|
|
1254
|
+
currentWorld: World | null;
|
|
1255
|
+
protected constructor(components: Components);
|
|
1256
|
+
}
|
|
1455
1257
|
import * as THREE from "three";
|
|
1456
1258
|
import CameraControls from "camera-controls";
|
|
1457
1259
|
import { BaseWorldItem } from "./base-world-item";
|
|
@@ -1495,134 +1297,459 @@ export declare abstract class BaseRenderer extends BaseWorldItem implements Upda
|
|
|
1495
1297
|
* Forces the update of the clipping planes and all components that depend
|
|
1496
1298
|
* on them that are subscribed to 'onClippingPlanesUpdated'.
|
|
1497
1299
|
*/
|
|
1498
|
-
updateClippingPlanes(): void;
|
|
1300
|
+
updateClippingPlanes(): void;
|
|
1301
|
+
/**
|
|
1302
|
+
* Adds or removes a
|
|
1303
|
+
* [clipping plane](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes)
|
|
1304
|
+
* to the renderer.
|
|
1305
|
+
*/
|
|
1306
|
+
setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
|
|
1307
|
+
}
|
|
1308
|
+
import * as THREE from "three";
|
|
1309
|
+
import { Disposable } from "./interfaces";
|
|
1310
|
+
import { Event } from "./event";
|
|
1311
|
+
import { Components } from "../../Components";
|
|
1312
|
+
import { BaseWorldItem } from "./base-world-item";
|
|
1313
|
+
export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
|
|
1314
|
+
/** {@link Disposable.onDisposed} */
|
|
1315
|
+
readonly onDisposed: Event<unknown>;
|
|
1316
|
+
abstract three: THREE.Object3D;
|
|
1317
|
+
protected constructor(components: Components);
|
|
1318
|
+
/** {@link Disposable.dispose} */
|
|
1319
|
+
dispose(): void;
|
|
1320
|
+
}
|
|
1321
|
+
import * as THREE from "three";
|
|
1322
|
+
import { BaseScene } from "./base-scene";
|
|
1323
|
+
import { BaseCamera } from "./base-camera";
|
|
1324
|
+
import { BaseRenderer } from "./base-renderer";
|
|
1325
|
+
import { Updateable, Disposable } from "./interfaces";
|
|
1326
|
+
export interface World extends Disposable, Updateable {
|
|
1327
|
+
meshes: Set<THREE.Mesh>;
|
|
1328
|
+
scene: BaseScene;
|
|
1329
|
+
camera: BaseCamera;
|
|
1330
|
+
renderer: BaseRenderer | null;
|
|
1331
|
+
uuid: string;
|
|
1332
|
+
}
|
|
1333
|
+
import * as THREE from "three";
|
|
1334
|
+
import { Disposable, Event } from "../../Types";
|
|
1335
|
+
/**
|
|
1336
|
+
* A helper to easily get the real position of the mouse in the Three.js canvas
|
|
1337
|
+
* to work with tools like the
|
|
1338
|
+
* [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has
|
|
1339
|
+
* been transformed through CSS or doesn't occupy the whole screen.
|
|
1340
|
+
*/
|
|
1341
|
+
export declare class Mouse implements Disposable {
|
|
1342
|
+
dom: HTMLCanvasElement;
|
|
1343
|
+
private _event?;
|
|
1344
|
+
private _position;
|
|
1345
|
+
/** {@link Disposable.onDisposed} */
|
|
1346
|
+
readonly onDisposed: Event<unknown>;
|
|
1347
|
+
constructor(dom: HTMLCanvasElement);
|
|
1348
|
+
/**
|
|
1349
|
+
* The real position of the mouse of the Three.js canvas.
|
|
1350
|
+
*/
|
|
1351
|
+
get position(): THREE.Vector2;
|
|
1352
|
+
/** {@link Disposable.dispose} */
|
|
1353
|
+
dispose(): void;
|
|
1354
|
+
private getPositionY;
|
|
1355
|
+
private getPositionX;
|
|
1356
|
+
private updateMouseInfo;
|
|
1357
|
+
private setupEvents;
|
|
1358
|
+
}
|
|
1359
|
+
import * as THREE from "three";
|
|
1360
|
+
import { Components } from "../../Components";
|
|
1361
|
+
import { Event, World, Disposable } from "../../Types";
|
|
1362
|
+
import { Mouse } from "./mouse";
|
|
1363
|
+
/**
|
|
1364
|
+
* A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster)
|
|
1365
|
+
* that allows to easily get items from the scene using the mouse and touch
|
|
1366
|
+
* events.
|
|
1367
|
+
*/
|
|
1368
|
+
export declare class SimpleRaycaster implements Disposable {
|
|
1369
|
+
/** {@link Component.enabled} */
|
|
1370
|
+
enabled: boolean;
|
|
1371
|
+
components: Components;
|
|
1372
|
+
/** {@link Disposable.onDisposed} */
|
|
1373
|
+
readonly onDisposed: Event<unknown>;
|
|
1374
|
+
/** The position of the mouse in the screen. */
|
|
1375
|
+
readonly mouse: Mouse;
|
|
1376
|
+
readonly three: THREE.Raycaster;
|
|
1377
|
+
world: World;
|
|
1378
|
+
constructor(components: Components, world: World);
|
|
1379
|
+
/** {@link Disposable.dispose} */
|
|
1380
|
+
dispose(): void;
|
|
1381
|
+
/**
|
|
1382
|
+
* Throws a ray from the camera to the mouse or touch event point and returns
|
|
1383
|
+
* the first item found. This also takes into account the clipping planes
|
|
1384
|
+
* used by the renderer.
|
|
1385
|
+
*
|
|
1386
|
+
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1387
|
+
* to query. If not provided, it will query all the meshes stored in
|
|
1388
|
+
* {@link Components.meshes}.
|
|
1389
|
+
*/
|
|
1390
|
+
castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
|
|
1391
|
+
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;
|
|
1392
|
+
private intersect;
|
|
1393
|
+
private filterClippingPlanes;
|
|
1394
|
+
}
|
|
1395
|
+
import * as THREE from "three";
|
|
1396
|
+
import { Event, Base, World, BaseScene, BaseCamera, BaseRenderer } from "../../Types";
|
|
1397
|
+
import { Components } from "../../Components";
|
|
1398
|
+
export declare class SimpleWorld<T extends BaseScene = BaseScene, U extends BaseCamera = BaseCamera, S extends BaseRenderer = BaseRenderer> extends Base implements World {
|
|
1399
|
+
/**
|
|
1400
|
+
* All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
|
|
1401
|
+
*/
|
|
1402
|
+
readonly meshes: Set<THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>>;
|
|
1403
|
+
readonly onAfterUpdate: Event<unknown>;
|
|
1404
|
+
readonly onBeforeUpdate: Event<unknown>;
|
|
1405
|
+
enabled: boolean;
|
|
1406
|
+
uuid: string;
|
|
1407
|
+
readonly onDisposed: Event<unknown>;
|
|
1408
|
+
private _scene?;
|
|
1409
|
+
private _camera?;
|
|
1410
|
+
private _renderer;
|
|
1411
|
+
get scene(): T;
|
|
1412
|
+
set scene(scene: T);
|
|
1413
|
+
get camera(): U;
|
|
1414
|
+
set camera(camera: U);
|
|
1415
|
+
get renderer(): S | null;
|
|
1416
|
+
set renderer(renderer: S | null);
|
|
1417
|
+
constructor(components: Components);
|
|
1418
|
+
update(delta?: number): void;
|
|
1419
|
+
dispose(disposeResources?: boolean): void;
|
|
1420
|
+
}
|
|
1421
|
+
import * as THREE from "three";
|
|
1422
|
+
import { BaseScene, Configurable, Event } from "../../Types";
|
|
1423
|
+
import { Components } from "../../Components";
|
|
1424
|
+
export interface SimpleSceneConfig {
|
|
1425
|
+
directionalLight: {
|
|
1426
|
+
color: THREE.Color;
|
|
1427
|
+
intensity: number;
|
|
1428
|
+
position: THREE.Vector3;
|
|
1429
|
+
};
|
|
1430
|
+
ambientLight: {
|
|
1431
|
+
color: THREE.Color;
|
|
1432
|
+
intensity: number;
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* A basic 3D [scene](https://threejs.org/docs/#api/en/scenes/Scene) to add
|
|
1437
|
+
* objects hierarchically, and easily dispose them when you are finished with it.
|
|
1438
|
+
* @noInheritDoc
|
|
1439
|
+
*/
|
|
1440
|
+
export declare class SimpleScene extends BaseScene implements Configurable<{}> {
|
|
1441
|
+
/** {@link Configurable.isSetup} */
|
|
1442
|
+
isSetup: boolean;
|
|
1443
|
+
three: THREE.Scene;
|
|
1444
|
+
/** {@link Configurable.onSetup} */
|
|
1445
|
+
readonly onSetup: Event<SimpleScene>;
|
|
1446
|
+
config: Required<SimpleSceneConfig>;
|
|
1447
|
+
constructor(components: Components);
|
|
1448
|
+
/** Creates a simple and nice default set up for the scene (e.g. lighting). */
|
|
1449
|
+
setup(config?: Partial<SimpleSceneConfig>): void;
|
|
1450
|
+
}
|
|
1451
|
+
import * as THREE from "three";
|
|
1452
|
+
import { BaseRenderer, Event } from "../../Types";
|
|
1453
|
+
import { Components } from "../../Components";
|
|
1454
|
+
/**
|
|
1455
|
+
* A basic renderer capable of rendering
|
|
1456
|
+
* ([Objec3Ds](https://threejs.org/docs/#api/en/core/Object3D).
|
|
1457
|
+
*/
|
|
1458
|
+
export declare class SimpleRenderer extends BaseRenderer {
|
|
1459
|
+
enabled: boolean;
|
|
1460
|
+
/** The HTML container of the THREE.js canvas where the scene is rendered. */
|
|
1461
|
+
container: HTMLElement;
|
|
1462
|
+
three: THREE.WebGLRenderer;
|
|
1463
|
+
protected _canvas: HTMLCanvasElement;
|
|
1464
|
+
protected _parameters?: Partial<THREE.WebGLRendererParameters>;
|
|
1465
|
+
protected _resizeObserver: ResizeObserver | null;
|
|
1466
|
+
protected onContainerUpdated: Event<unknown>;
|
|
1467
|
+
private _resizing;
|
|
1468
|
+
constructor(components: Components, container: HTMLElement, parameters?: Partial<THREE.WebGLRendererParameters>);
|
|
1469
|
+
/** {@link Updateable.update} */
|
|
1470
|
+
update(): void;
|
|
1471
|
+
/** {@link Disposable.dispose} */
|
|
1472
|
+
dispose(): void;
|
|
1473
|
+
/** {@link Resizeable.getSize}. */
|
|
1474
|
+
getSize(): THREE.Vector2;
|
|
1475
|
+
/** {@link Resizeable.resize} */
|
|
1476
|
+
resize: (size?: THREE.Vector2) => void;
|
|
1477
|
+
setupEvents(active: boolean): void;
|
|
1478
|
+
private resizeEvent;
|
|
1479
|
+
private setupRenderer;
|
|
1480
|
+
private onContextLost;
|
|
1481
|
+
private onContextBack;
|
|
1482
|
+
}
|
|
1483
|
+
import * as THREE from "three";
|
|
1484
|
+
import CameraControls from "camera-controls";
|
|
1485
|
+
import { Disposable, Updateable, Event, BaseCamera } from "../../Types";
|
|
1486
|
+
import { Components } from "../../Components";
|
|
1487
|
+
/**
|
|
1488
|
+
* A basic camera that uses
|
|
1489
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to
|
|
1490
|
+
* easily control the camera in 2D and 3D. Check out it's API to find out
|
|
1491
|
+
* what features it offers.
|
|
1492
|
+
*/
|
|
1493
|
+
export declare class SimpleCamera extends BaseCamera implements Updateable, Disposable {
|
|
1494
|
+
/** {@link Updateable.onBeforeUpdate} */
|
|
1495
|
+
readonly onBeforeUpdate: Event<SimpleCamera>;
|
|
1496
|
+
/** {@link Updateable.onAfterUpdate} */
|
|
1497
|
+
readonly onAfterUpdate: Event<SimpleCamera>;
|
|
1498
|
+
readonly onAspectUpdated: Event<unknown>;
|
|
1499
|
+
/** {@link Disposable.onDisposed} */
|
|
1500
|
+
readonly onDisposed: Event<string>;
|
|
1501
|
+
three: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1502
|
+
private _allControls;
|
|
1503
|
+
/**
|
|
1504
|
+
* The object that controls the camera. An instance of
|
|
1505
|
+
* [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls).
|
|
1506
|
+
* Transforming the camera directly will have no effect: you need to use this
|
|
1507
|
+
* object to move, rotate, look at objects, etc.
|
|
1508
|
+
*/
|
|
1509
|
+
get controls(): CameraControls;
|
|
1510
|
+
/** {@link Component.enabled} */
|
|
1511
|
+
get enabled(): boolean;
|
|
1512
|
+
/** {@link Component.enabled} */
|
|
1513
|
+
set enabled(enabled: boolean);
|
|
1514
|
+
constructor(components: Components);
|
|
1515
|
+
/** {@link Disposable.dispose} */
|
|
1516
|
+
dispose(): void;
|
|
1517
|
+
/** {@link Updateable.update} */
|
|
1518
|
+
update(_delta: number): void;
|
|
1499
1519
|
/**
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1502
|
-
* to the renderer.
|
|
1520
|
+
* Updates the aspect of the camera to match the size of the
|
|
1521
|
+
* {@link Components.renderer}.
|
|
1503
1522
|
*/
|
|
1504
|
-
|
|
1523
|
+
updateAspect: () => void;
|
|
1524
|
+
private setupCamera;
|
|
1525
|
+
private newCameraControls;
|
|
1526
|
+
private setupEvents;
|
|
1527
|
+
private static getSubsetOfThree;
|
|
1505
1528
|
}
|
|
1529
|
+
/// <reference types="node" />
|
|
1506
1530
|
import * as THREE from "three";
|
|
1507
|
-
import {
|
|
1508
|
-
import { Event } from "./event";
|
|
1531
|
+
import { Hideable, Event, World } from "../../Types";
|
|
1509
1532
|
import { Components } from "../../Components";
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
protected constructor(components: Components);
|
|
1516
|
-
/** {@link Disposable.dispose} */
|
|
1517
|
-
dispose(): void;
|
|
1533
|
+
export interface GridConfig {
|
|
1534
|
+
color: THREE.Color;
|
|
1535
|
+
size1: number;
|
|
1536
|
+
size2: number;
|
|
1537
|
+
distance: number;
|
|
1518
1538
|
}
|
|
1519
|
-
import * as THREE from "three";
|
|
1520
|
-
import { Disposable, Event } from "../../Types";
|
|
1521
1539
|
/**
|
|
1522
|
-
*
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1540
|
+
* An infinite grid. Created by
|
|
1541
|
+
* [fyrestar](https://github.com/Fyrestar/THREE.InfiniteGridHelper)
|
|
1542
|
+
* and translated to typescript by
|
|
1543
|
+
* [dkaraush](https://github.com/dkaraush/THREE.InfiniteGridHelper/blob/master/InfiniteGridHelper.ts).
|
|
1526
1544
|
*/
|
|
1527
|
-
export declare class
|
|
1528
|
-
dom: HTMLCanvasElement;
|
|
1529
|
-
private _event?;
|
|
1530
|
-
private _position;
|
|
1545
|
+
export declare class SimpleGrid implements Hideable, Disposable {
|
|
1531
1546
|
/** {@link Disposable.onDisposed} */
|
|
1532
1547
|
readonly onDisposed: Event<unknown>;
|
|
1533
|
-
|
|
1548
|
+
world: World;
|
|
1549
|
+
components: Components;
|
|
1550
|
+
/** {@link Hideable.visible} */
|
|
1551
|
+
get visible(): boolean;
|
|
1552
|
+
/** {@link Hideable.visible} */
|
|
1553
|
+
set visible(visible: boolean);
|
|
1554
|
+
/** The material of the grid. */
|
|
1555
|
+
get material(): THREE.ShaderMaterial;
|
|
1534
1556
|
/**
|
|
1535
|
-
*
|
|
1557
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1558
|
+
* perspective cameras and false for orthographic cameras.
|
|
1536
1559
|
*/
|
|
1537
|
-
get
|
|
1560
|
+
get fade(): boolean;
|
|
1561
|
+
/**
|
|
1562
|
+
* Whether the grid should fade away with distance. Recommended to be true for
|
|
1563
|
+
* perspective cameras and false for orthographic cameras.
|
|
1564
|
+
*/
|
|
1565
|
+
set fade(active: boolean);
|
|
1566
|
+
readonly three: THREE.Mesh;
|
|
1567
|
+
private _fade;
|
|
1568
|
+
constructor(components: Components, world: World, config: GridConfig);
|
|
1569
|
+
[Symbol.dispose](): void;
|
|
1538
1570
|
/** {@link Disposable.dispose} */
|
|
1539
1571
|
dispose(): void;
|
|
1540
|
-
private getPositionY;
|
|
1541
|
-
private getPositionX;
|
|
1542
|
-
private updateMouseInfo;
|
|
1543
1572
|
private setupEvents;
|
|
1573
|
+
private updateZoom;
|
|
1544
1574
|
}
|
|
1545
1575
|
import * as THREE from "three";
|
|
1546
|
-
import {
|
|
1547
|
-
import {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
camera: BaseCamera;
|
|
1554
|
-
renderer: BaseRenderer | null;
|
|
1555
|
-
uuid: string;
|
|
1576
|
+
import { Components } from "../../Components";
|
|
1577
|
+
import { AsyncEvent, Event, World } from "../../Types";
|
|
1578
|
+
export interface CullerRendererSettings {
|
|
1579
|
+
updateInterval?: number;
|
|
1580
|
+
width?: number;
|
|
1581
|
+
height?: number;
|
|
1582
|
+
autoUpdate?: boolean;
|
|
1556
1583
|
}
|
|
1557
|
-
import { NavigationMode } from "./types";
|
|
1558
1584
|
/**
|
|
1559
|
-
* A
|
|
1560
|
-
* simulating FPS video games.
|
|
1585
|
+
* A base renderer to determine visibility on screen
|
|
1561
1586
|
*/
|
|
1562
|
-
export declare class
|
|
1563
|
-
|
|
1564
|
-
|
|
1587
|
+
export declare class CullerRenderer {
|
|
1588
|
+
/** {@link Disposable.onDisposed} */
|
|
1589
|
+
readonly onDisposed: Event<string>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Fires after making the visibility check to the meshes. It lists the
|
|
1592
|
+
* meshes that are currently visible, and the ones that were visible
|
|
1593
|
+
* just before but not anymore.
|
|
1594
|
+
*/
|
|
1595
|
+
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1596
|
+
/** {@link Component.enabled} */
|
|
1565
1597
|
enabled: boolean;
|
|
1566
|
-
/**
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1598
|
+
/**
|
|
1599
|
+
* Needs to check whether there are objects that need to be hidden or shown.
|
|
1600
|
+
* You can bind this to the camera movement, to a certain interval, etc.
|
|
1601
|
+
*/
|
|
1602
|
+
needsUpdate: boolean;
|
|
1603
|
+
/**
|
|
1604
|
+
* Render the internal scene used to determine the object visibility. Used
|
|
1605
|
+
* for debugging purposes.
|
|
1606
|
+
*/
|
|
1607
|
+
renderDebugFrame: boolean;
|
|
1608
|
+
components: Components;
|
|
1609
|
+
readonly world: World;
|
|
1610
|
+
readonly renderer: THREE.WebGLRenderer;
|
|
1611
|
+
protected autoUpdate: boolean;
|
|
1612
|
+
protected updateInterval: number;
|
|
1613
|
+
protected readonly worker: Worker;
|
|
1614
|
+
protected readonly scene: THREE.Scene;
|
|
1615
|
+
private _width;
|
|
1616
|
+
private _height;
|
|
1617
|
+
private _availableColor;
|
|
1618
|
+
private readonly renderTarget;
|
|
1619
|
+
private readonly bufferSize;
|
|
1620
|
+
private readonly _buffer;
|
|
1621
|
+
protected _isWorkerBusy: boolean;
|
|
1622
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1623
|
+
/** {@link Disposable.dispose} */
|
|
1624
|
+
dispose(): void;
|
|
1625
|
+
/**
|
|
1626
|
+
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1627
|
+
* better to call needsUpdate, but you can also call this to force it.
|
|
1628
|
+
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1629
|
+
* not true.
|
|
1630
|
+
*/
|
|
1631
|
+
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1632
|
+
protected getAvailableColor(): {
|
|
1633
|
+
r: number;
|
|
1634
|
+
g: number;
|
|
1635
|
+
b: number;
|
|
1636
|
+
code: string;
|
|
1637
|
+
};
|
|
1638
|
+
protected increaseColor(): void;
|
|
1639
|
+
protected decreaseColor(): void;
|
|
1640
|
+
private applySettings;
|
|
1572
1641
|
}
|
|
1573
1642
|
import * as THREE from "three";
|
|
1643
|
+
import { CullerRenderer, CullerRendererSettings } from "./culler-renderer";
|
|
1574
1644
|
import { Components } from "../../Components";
|
|
1575
|
-
import { Event, World
|
|
1576
|
-
import { Mouse } from "./mouse";
|
|
1645
|
+
import { Event, World } from "../../Types";
|
|
1577
1646
|
/**
|
|
1578
|
-
* A
|
|
1579
|
-
* that allows to easily get items from the scene using the mouse and touch
|
|
1580
|
-
* events.
|
|
1647
|
+
* A renderer to determine a mesh visibility on screen
|
|
1581
1648
|
*/
|
|
1582
|
-
export declare class
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1649
|
+
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1650
|
+
threshold: number;
|
|
1651
|
+
readonly onViewUpdated: Event<{
|
|
1652
|
+
seen: Set<THREE.Mesh>;
|
|
1653
|
+
unseen: Set<THREE.Mesh>;
|
|
1654
|
+
}>;
|
|
1655
|
+
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1656
|
+
isProcessing: boolean;
|
|
1657
|
+
private _colorCodeMeshMap;
|
|
1658
|
+
private _meshIDColorCodeMap;
|
|
1659
|
+
private _currentVisibleMeshes;
|
|
1660
|
+
private _recentlyHiddenMeshes;
|
|
1661
|
+
private _intervalID;
|
|
1662
|
+
private readonly _transparentMat;
|
|
1663
|
+
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1594
1664
|
dispose(): void;
|
|
1665
|
+
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1666
|
+
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1667
|
+
private handleWorkerMessage;
|
|
1668
|
+
private getAvailableMaterial;
|
|
1669
|
+
}
|
|
1670
|
+
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1671
|
+
import * as WEBIFC from "web-ifc";
|
|
1672
|
+
/** Configuration of the IFC-fragment conversion. */
|
|
1673
|
+
export declare class IfcFragmentSettings {
|
|
1674
|
+
/** Whether to extract the IFC properties into a JSON. */
|
|
1675
|
+
includeProperties: boolean;
|
|
1595
1676
|
/**
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1598
|
-
* used by the renderer.
|
|
1599
|
-
*
|
|
1600
|
-
* @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
|
|
1601
|
-
* to query. If not provided, it will query all the meshes stored in
|
|
1602
|
-
* {@link Components.meshes}.
|
|
1677
|
+
* Generate the geometry for categories that are not included by default,
|
|
1678
|
+
* like IFCSPACE.
|
|
1603
1679
|
*/
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1680
|
+
optionalCategories: number[];
|
|
1681
|
+
/** Whether to use the coordination data coming from the IFC files. */
|
|
1682
|
+
coordinate: boolean;
|
|
1683
|
+
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1684
|
+
wasm: {
|
|
1685
|
+
path: string;
|
|
1686
|
+
absolute: boolean;
|
|
1687
|
+
logLevel?: WEBIFC.LogLevel;
|
|
1688
|
+
};
|
|
1689
|
+
/** List of categories that won't be converted to fragments. */
|
|
1690
|
+
excludedCategories: Set<number>;
|
|
1691
|
+
/** Whether to save the absolute location of all IFC items. */
|
|
1692
|
+
saveLocations: boolean;
|
|
1693
|
+
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1694
|
+
webIfc: WEBIFC.LoaderSettings;
|
|
1695
|
+
autoSetWasm: boolean;
|
|
1696
|
+
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1697
|
+
}
|
|
1698
|
+
import * as THREE from "three";
|
|
1699
|
+
import * as WEBIFC from "web-ifc";
|
|
1700
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
1701
|
+
export declare class CivilReader {
|
|
1702
|
+
defLineMat: THREE.LineBasicMaterial;
|
|
1703
|
+
read(webIfc: WEBIFC.IfcAPI): {
|
|
1704
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1705
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1706
|
+
} | undefined;
|
|
1707
|
+
get(civilItems: any): {
|
|
1708
|
+
alignments: Map<number, FRAGS.Alignment>;
|
|
1709
|
+
coordinationMatrix: THREE.Matrix4;
|
|
1710
|
+
} | undefined;
|
|
1711
|
+
private getCurves;
|
|
1712
|
+
}
|
|
1713
|
+
import * as WEBIFC from "web-ifc";
|
|
1714
|
+
export declare class IfcMetadataReader {
|
|
1715
|
+
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1716
|
+
}
|
|
1717
|
+
import { NavigationMode } from "./types";
|
|
1718
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1719
|
+
/**
|
|
1720
|
+
* A {@link NavigationMode} that allows first person navigation,
|
|
1721
|
+
* simulating FPS video games.
|
|
1722
|
+
*/
|
|
1723
|
+
export declare class FirstPersonMode implements NavigationMode {
|
|
1724
|
+
private camera;
|
|
1725
|
+
/** {@link NavigationMode.enabled} */
|
|
1726
|
+
enabled: boolean;
|
|
1727
|
+
/** {@link NavigationMode.id} */
|
|
1728
|
+
readonly id = "FirstPerson";
|
|
1729
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1730
|
+
/** {@link NavigationMode.set} */
|
|
1731
|
+
set(active: boolean): void;
|
|
1732
|
+
private setupFirstPersonCamera;
|
|
1608
1733
|
}
|
|
1609
1734
|
import { NavigationMode } from "./types";
|
|
1735
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1610
1736
|
/**
|
|
1611
1737
|
* A {@link NavigationMode} that allows 3D navigation and panning
|
|
1612
1738
|
* like in many 3D and CAD softwares.
|
|
1613
1739
|
*/
|
|
1614
1740
|
export declare class OrbitMode implements NavigationMode {
|
|
1615
|
-
camera:
|
|
1741
|
+
camera: OrthoPerspectiveCamera;
|
|
1616
1742
|
/** {@link NavigationMode.enabled} */
|
|
1617
1743
|
enabled: boolean;
|
|
1618
1744
|
/** {@link NavigationMode.id} */
|
|
1619
1745
|
readonly id = "Orbit";
|
|
1620
|
-
constructor(camera:
|
|
1746
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1621
1747
|
/** {@link NavigationMode.set} */
|
|
1622
1748
|
set(active: boolean): void;
|
|
1623
1749
|
private activateOrbitControls;
|
|
1624
1750
|
}
|
|
1625
1751
|
import { NavigationMode } from "./types";
|
|
1752
|
+
import { OrthoPerspectiveCamera } from "../index";
|
|
1626
1753
|
/**
|
|
1627
1754
|
* A {@link NavigationMode} that allows to navigate floorplans in 2D,
|
|
1628
1755
|
* like many BIM tools.
|
|
@@ -1638,13 +1765,13 @@ export declare class PlanMode implements NavigationMode {
|
|
|
1638
1765
|
private mouseInitialized;
|
|
1639
1766
|
private readonly defaultAzimuthSpeed;
|
|
1640
1767
|
private readonly defaultPolarSpeed;
|
|
1641
|
-
constructor(camera:
|
|
1768
|
+
constructor(camera: OrthoPerspectiveCamera);
|
|
1642
1769
|
/** {@link NavigationMode.set} */
|
|
1643
1770
|
set(active: boolean): void;
|
|
1644
1771
|
}
|
|
1645
1772
|
import * as THREE from "three";
|
|
1646
1773
|
import { CameraProjection } from "./types";
|
|
1647
|
-
import { Event } from "
|
|
1774
|
+
import { Event } from "../../Types";
|
|
1648
1775
|
import { OrthoPerspectiveCamera } from "../index";
|
|
1649
1776
|
/**
|
|
1650
1777
|
* Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
|
|
@@ -1653,7 +1780,7 @@ export declare class ProjectionManager {
|
|
|
1653
1780
|
/**
|
|
1654
1781
|
* Event that fires when the {@link CameraProjection} changes.
|
|
1655
1782
|
*/
|
|
1656
|
-
readonly onChanged: Event<THREE.
|
|
1783
|
+
readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
|
|
1657
1784
|
current: CameraProjection;
|
|
1658
1785
|
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
1659
1786
|
private _component;
|
|
@@ -1674,7 +1801,7 @@ export declare class ProjectionManager {
|
|
|
1674
1801
|
*/
|
|
1675
1802
|
toggle(): Promise<void>;
|
|
1676
1803
|
private setOrthoCamera;
|
|
1677
|
-
private
|
|
1804
|
+
private getPerspectiveDims;
|
|
1678
1805
|
private setupOrthoCamera;
|
|
1679
1806
|
private getDistance;
|
|
1680
1807
|
private setPerspectiveCamera;
|
|
@@ -1706,102 +1833,58 @@ export interface NavigationMode {
|
|
|
1706
1833
|
/** Whether this navigation mode is active or not. */
|
|
1707
1834
|
enabled: boolean;
|
|
1708
1835
|
}
|
|
1709
|
-
import
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
width?: number;
|
|
1715
|
-
height?: number;
|
|
1716
|
-
autoUpdate?: boolean;
|
|
1836
|
+
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
1837
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1838
|
+
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1839
|
+
minGeometrySize: number;
|
|
1840
|
+
minAssetsSize: number;
|
|
1717
1841
|
}
|
|
1718
|
-
/**
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1842
|
+
/** Configuration of the IFC-fragment streaming. */
|
|
1843
|
+
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1844
|
+
propertiesSize: number;
|
|
1845
|
+
}
|
|
1846
|
+
import * as WEBIFC from "web-ifc";
|
|
1847
|
+
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1848
|
+
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1849
|
+
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1850
|
+
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1851
|
+
onPropertiesStreamed: AsyncEvent<{
|
|
1852
|
+
type: number;
|
|
1853
|
+
data: {
|
|
1854
|
+
[id: number]: any;
|
|
1855
|
+
};
|
|
1856
|
+
}>;
|
|
1857
|
+
onProgress: AsyncEvent<number>;
|
|
1858
|
+
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1722
1859
|
/** {@link Disposable.onDisposed} */
|
|
1723
1860
|
readonly onDisposed: Event<string>;
|
|
1724
|
-
/**
|
|
1725
|
-
* Fires after making the visibility check to the meshes. It lists the
|
|
1726
|
-
* meshes that are currently visible, and the ones that were visible
|
|
1727
|
-
* just before but not anymore.
|
|
1728
|
-
*/
|
|
1729
|
-
readonly onViewUpdated: Event<any> | AsyncEvent<any>;
|
|
1730
|
-
/** {@link Component.enabled} */
|
|
1731
1861
|
enabled: boolean;
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
protected readonly scene: THREE.Scene;
|
|
1749
|
-
private _width;
|
|
1750
|
-
private _height;
|
|
1751
|
-
private _availableColor;
|
|
1752
|
-
private readonly renderTarget;
|
|
1753
|
-
private readonly bufferSize;
|
|
1754
|
-
private readonly _buffer;
|
|
1755
|
-
protected _isWorkerBusy: boolean;
|
|
1756
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1757
|
-
/** {@link Disposable.dispose} */
|
|
1758
|
-
dispose(): void;
|
|
1759
|
-
/**
|
|
1760
|
-
* The function that the culler uses to reprocess the scene. Generally it's
|
|
1761
|
-
* better to call needsUpdate, but you can also call this to force it.
|
|
1762
|
-
* @param force if true, it will refresh the scene even if needsUpdate is
|
|
1763
|
-
* not true.
|
|
1764
|
-
*/
|
|
1765
|
-
updateVisibility: (force?: boolean) => Promise<void>;
|
|
1766
|
-
protected getAvailableColor(): {
|
|
1767
|
-
r: number;
|
|
1768
|
-
g: number;
|
|
1769
|
-
b: number;
|
|
1770
|
-
code: string;
|
|
1862
|
+
settings: PropertiesStreamingSettings;
|
|
1863
|
+
webIfc: WEBIFC.IfcAPI;
|
|
1864
|
+
dispose(): Promise<void>;
|
|
1865
|
+
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1866
|
+
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1867
|
+
private readIfcFile;
|
|
1868
|
+
private streamIfcFile;
|
|
1869
|
+
private streamAllProperties;
|
|
1870
|
+
private getIndices;
|
|
1871
|
+
private cleanUp;
|
|
1872
|
+
}
|
|
1873
|
+
export interface StreamedGeometries {
|
|
1874
|
+
[id: number]: {
|
|
1875
|
+
boundingBox: Float32Array;
|
|
1876
|
+
hasHoles: boolean;
|
|
1877
|
+
geometryFile?: string;
|
|
1771
1878
|
};
|
|
1772
|
-
protected increaseColor(): void;
|
|
1773
|
-
protected decreaseColor(): void;
|
|
1774
|
-
private applySettings;
|
|
1775
1879
|
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
export declare class MeshCullerRenderer extends CullerRenderer {
|
|
1784
|
-
threshold: number;
|
|
1785
|
-
readonly onViewUpdated: Event<{
|
|
1786
|
-
seen: Set<THREE.Mesh>;
|
|
1787
|
-
unseen: Set<THREE.Mesh>;
|
|
1788
|
-
}>;
|
|
1789
|
-
colorMeshes: Map<string, THREE.InstancedMesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[]>>;
|
|
1790
|
-
isProcessing: boolean;
|
|
1791
|
-
private _colorCodeMeshMap;
|
|
1792
|
-
private _meshIDColorCodeMap;
|
|
1793
|
-
private _currentVisibleMeshes;
|
|
1794
|
-
private _recentlyHiddenMeshes;
|
|
1795
|
-
private _intervalID;
|
|
1796
|
-
private readonly _transparentMat;
|
|
1797
|
-
constructor(components: Components, world: World, settings?: CullerRendererSettings);
|
|
1798
|
-
dispose(): void;
|
|
1799
|
-
add(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1800
|
-
remove(mesh: THREE.Mesh | THREE.InstancedMesh): void;
|
|
1801
|
-
private handleWorkerMessage;
|
|
1802
|
-
private getAvailableMaterial;
|
|
1880
|
+
export interface StreamedAsset {
|
|
1881
|
+
id: number;
|
|
1882
|
+
geometries: {
|
|
1883
|
+
geometryID: number;
|
|
1884
|
+
transformation: number[];
|
|
1885
|
+
color: number[];
|
|
1886
|
+
}[];
|
|
1803
1887
|
}
|
|
1804
|
-
export declare function readPixelsAsync(gl: WebGL2RenderingContext, x: number, y: number, w: number, h: number, format: any, type: any, dest: ArrayBufferView): Promise<ArrayBufferView>;
|
|
1805
1888
|
import * as THREE from "three";
|
|
1806
1889
|
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
1807
1890
|
import { Components } from "../../Components";
|
|
@@ -1847,9 +1930,9 @@ export declare class SimplePlane implements Disposable, Hideable {
|
|
|
1847
1930
|
set size(size: number);
|
|
1848
1931
|
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
1849
1932
|
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
1850
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3):
|
|
1933
|
+
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
1851
1934
|
/** {@link Updateable.update} */
|
|
1852
|
-
update: () =>
|
|
1935
|
+
update: () => void;
|
|
1853
1936
|
/** {@link Disposable.dispose} */
|
|
1854
1937
|
dispose(): void;
|
|
1855
1938
|
private reset;
|
|
@@ -1873,104 +1956,6 @@ export declare class Units {
|
|
|
1873
1956
|
private getLengthUnits;
|
|
1874
1957
|
private getScaleMatrix;
|
|
1875
1958
|
}
|
|
1876
|
-
import * as WEBIFC from "web-ifc";
|
|
1877
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../../core";
|
|
1878
|
-
import { PropertiesStreamingSettings } from "./streaming-settings";
|
|
1879
|
-
export declare class FragmentPropsStreamConverter extends Component implements Disposable {
|
|
1880
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
1881
|
-
onPropertiesStreamed: AsyncEvent<{
|
|
1882
|
-
type: number;
|
|
1883
|
-
data: {
|
|
1884
|
-
[id: number]: any;
|
|
1885
|
-
};
|
|
1886
|
-
}>;
|
|
1887
|
-
onProgress: AsyncEvent<number>;
|
|
1888
|
-
onIndicesStreamed: AsyncEvent<number[][]>;
|
|
1889
|
-
/** {@link Disposable.onDisposed} */
|
|
1890
|
-
readonly onDisposed: Event<string>;
|
|
1891
|
-
enabled: boolean;
|
|
1892
|
-
settings: PropertiesStreamingSettings;
|
|
1893
|
-
webIfc: WEBIFC.IfcAPI;
|
|
1894
|
-
dispose(): Promise<void>;
|
|
1895
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
1896
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
1897
|
-
private readIfcFile;
|
|
1898
|
-
private streamIfcFile;
|
|
1899
|
-
private streamAllProperties;
|
|
1900
|
-
private getIndices;
|
|
1901
|
-
private cleanUp;
|
|
1902
|
-
}
|
|
1903
|
-
export interface StreamedGeometries {
|
|
1904
|
-
[id: number]: {
|
|
1905
|
-
boundingBox: Float32Array;
|
|
1906
|
-
hasHoles: boolean;
|
|
1907
|
-
geometryFile?: string;
|
|
1908
|
-
};
|
|
1909
|
-
}
|
|
1910
|
-
export interface StreamedAsset {
|
|
1911
|
-
id: number;
|
|
1912
|
-
geometries: {
|
|
1913
|
-
geometryID: number;
|
|
1914
|
-
transformation: number[];
|
|
1915
|
-
color: number[];
|
|
1916
|
-
}[];
|
|
1917
|
-
}
|
|
1918
|
-
import * as THREE from "three";
|
|
1919
|
-
import * as WEBIFC from "web-ifc";
|
|
1920
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
1921
|
-
export declare class CivilReader {
|
|
1922
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
1923
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
1924
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1925
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1926
|
-
} | undefined;
|
|
1927
|
-
get(civilItems: any): {
|
|
1928
|
-
alignments: Map<number, FRAGS.Alignment>;
|
|
1929
|
-
coordinationMatrix: THREE.Matrix4;
|
|
1930
|
-
} | undefined;
|
|
1931
|
-
private getCurves;
|
|
1932
|
-
}
|
|
1933
|
-
import { IfcFragmentSettings } from "../../FragmentIfcLoader/src";
|
|
1934
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1935
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
1936
|
-
minGeometrySize: number;
|
|
1937
|
-
minAssetsSize: number;
|
|
1938
|
-
}
|
|
1939
|
-
/** Configuration of the IFC-fragment streaming. */
|
|
1940
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
1941
|
-
propertiesSize: number;
|
|
1942
|
-
}
|
|
1943
|
-
import * as WEBIFC from "web-ifc";
|
|
1944
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
1945
|
-
export declare class IfcFragmentSettings {
|
|
1946
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
1947
|
-
includeProperties: boolean;
|
|
1948
|
-
/**
|
|
1949
|
-
* Generate the geometry for categories that are not included by default,
|
|
1950
|
-
* like IFCSPACE.
|
|
1951
|
-
*/
|
|
1952
|
-
optionalCategories: number[];
|
|
1953
|
-
/** Whether to use the coordination data coming from the IFC files. */
|
|
1954
|
-
coordinate: boolean;
|
|
1955
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1956
|
-
wasm: {
|
|
1957
|
-
path: string;
|
|
1958
|
-
absolute: boolean;
|
|
1959
|
-
logLevel?: WEBIFC.LogLevel;
|
|
1960
|
-
};
|
|
1961
|
-
/** List of categories that won't be converted to fragments. */
|
|
1962
|
-
excludedCategories: Set<number>;
|
|
1963
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
1964
|
-
saveLocations: boolean;
|
|
1965
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
1966
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
1967
|
-
autoSetWasm: boolean;
|
|
1968
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
1969
|
-
}
|
|
1970
|
-
import * as WEBIFC from "web-ifc";
|
|
1971
|
-
export declare class IfcMetadataReader {
|
|
1972
|
-
get(webIfc: WEBIFC.IfcAPI, type: number): string;
|
|
1973
|
-
}
|
|
1974
1959
|
export type RelationsMap = Map<number, Map<number, number[]>>;
|
|
1975
1960
|
export interface ModelsRelationMap {
|
|
1976
1961
|
[modelID: string]: RelationsMap;
|
|
@@ -2000,28 +1985,5 @@ import * as THREE from "three";
|
|
|
2000
1985
|
export declare class TransformHelper {
|
|
2001
1986
|
getHelper(geometries: BufferGeometry[]): THREE.Object3D<THREE.Object3DEventMap>;
|
|
2002
1987
|
}
|
|
2003
|
-
export type QueryConditions = "is" | "includes" | "startsWith" | "endsWith" | "matches";
|
|
2004
|
-
export type ConditionFunctions = {
|
|
2005
|
-
[queryCondition in QueryConditions]: (leftValue: string | boolean | number, rightValue: string | boolean | number) => boolean;
|
|
2006
|
-
};
|
|
2007
|
-
export type QueryOperators = "AND" | "OR";
|
|
2008
|
-
export interface AttributeQuery {
|
|
2009
|
-
operator?: QueryOperators;
|
|
2010
|
-
attribute: string;
|
|
2011
|
-
condition: QueryConditions;
|
|
2012
|
-
value: string | number | boolean;
|
|
2013
|
-
negateResult?: boolean;
|
|
2014
|
-
caseSensitive?: boolean;
|
|
2015
|
-
}
|
|
2016
|
-
export interface QueryGroup {
|
|
2017
|
-
operator?: QueryOperators;
|
|
2018
|
-
description?: string;
|
|
2019
|
-
queries: (AttributeQuery | QueryGroup)[];
|
|
2020
|
-
}
|
|
2021
|
-
export interface Query {
|
|
2022
|
-
name: string;
|
|
2023
|
-
description?: string;
|
|
2024
|
-
groups: QueryGroup;
|
|
2025
|
-
}
|
|
2026
1988
|
|
|
2027
1989
|
}
|