@thatopen/components 2.4.11 → 3.1.0
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/README.md +92 -92
- package/dist/index.cjs +18440 -25937
- package/dist/index.d.ts +4537 -6
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +3 -3
- package/dist/index.mjs +18442 -25939
- package/package.json +58 -60
- package/dist/core/Clipper/index.d.ts +0 -142
- package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
- package/dist/core/Clipper/src/index.d.ts +0 -1
- package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
- package/dist/core/Components/index.d.ts +0 -93
- package/dist/core/ConfigManager/index.d.ts +0 -21
- package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
- package/dist/core/ConfigManager/src/index.d.ts +0 -1
- package/dist/core/Cullers/index.d.ts +0 -56
- package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
- package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
- package/dist/core/Cullers/src/index.d.ts +0 -3
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
- package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
- package/dist/core/Disposer/index.d.ts +0 -45
- package/dist/core/Grids/index.d.ts +0 -46
- package/dist/core/Grids/src/index.d.ts +0 -2
- package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
- package/dist/core/Grids/src/simple-grid.d.ts +0 -48
- package/dist/core/MiniMap/index.d.ts +0 -50
- package/dist/core/MiniMap/src/index.d.ts +0 -2
- package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
- package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
- package/dist/core/Raycasters/index.d.ts +0 -43
- package/dist/core/Raycasters/src/index.d.ts +0 -2
- package/dist/core/Raycasters/src/mouse.d.ts +0 -24
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
- package/dist/core/ShadowedScene/index.d.ts +0 -57
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
- package/dist/core/ShadowedScene/src/index.d.ts +0 -1
- package/dist/core/Types/index.d.ts +0 -1
- package/dist/core/Types/src/async-event.d.ts +0 -32
- package/dist/core/Types/src/base-camera.d.ts +0 -28
- package/dist/core/Types/src/base-renderer.d.ts +0 -65
- package/dist/core/Types/src/base-scene.d.ts +0 -25
- package/dist/core/Types/src/base-world-item.d.ts +0 -23
- package/dist/core/Types/src/base.d.ts +0 -19
- package/dist/core/Types/src/component-with-ui.d.ts +0 -18
- package/dist/core/Types/src/component.d.ts +0 -13
- package/dist/core/Types/src/config-types.d.ts +0 -47
- package/dist/core/Types/src/data-map.d.ts +0 -73
- package/dist/core/Types/src/data-set.d.ts +0 -58
- package/dist/core/Types/src/event-manager.d.ts +0 -30
- package/dist/core/Types/src/event.d.ts +0 -32
- package/dist/core/Types/src/index.d.ts +0 -15
- package/dist/core/Types/src/interfaces.d.ts +0 -117
- package/dist/core/Types/src/world.d.ts +0 -34
- package/dist/core/Viewpoints/index.d.ts +0 -38
- package/dist/core/Viewpoints/src/index.d.ts +0 -2
- package/dist/core/Viewpoints/src/types.d.ts +0 -36
- package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
- package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
- package/dist/core/Worlds/index.d.ts +0 -54
- package/dist/core/Worlds/src/index.d.ts +0 -5
- package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
- package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
- package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
- package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
- package/dist/core/Worlds/src/simple-world.d.ts +0 -79
- package/dist/core/index.d.ts +0 -13
- package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
- package/dist/fragments/Classifier/index.d.ts +0 -197
- package/dist/fragments/Exploder/index.d.ts +0 -50
- package/dist/fragments/FragmentsManager/index.d.ts +0 -152
- package/dist/fragments/Hider/index.d.ts +0 -38
- package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
- package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
- package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
- package/dist/fragments/IfcLoader/index.d.ts +0 -116
- package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
- package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
- package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
- package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
- package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
- package/dist/fragments/index.d.ts +0 -8
- package/dist/ifc/IfcFinder/index.d.ts +0 -50
- package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
- package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
- package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
- package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
- package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
- package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
- package/dist/ifc/IfcIsolator/index.d.ts +0 -24
- package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
- package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
- package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
- package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
- package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
- package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
- package/dist/ifc/Utils/index.d.ts +0 -5
- package/dist/ifc/Utils/properties-utils.d.ts +0 -25
- package/dist/ifc/index.d.ts +0 -6
- package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
- package/dist/measurement/index.d.ts +0 -1
- package/dist/namespace.d.ts +0 -6018
- package/dist/openbim/BCFTopics/index.d.ts +0 -114
- package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
- package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
- package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
- package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
- package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
- package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
- package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
- package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
- package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
- package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
- package/dist/openbim/index.d.ts +0 -2
- package/dist/utils/bbox.d.ts +0 -7
- package/dist/utils/geometry.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/materials.d.ts +0 -4
- package/dist/utils/section-generator.d.ts +0 -31
- package/dist/utils/uuid.d.ts +0 -6
- package/dist/utils/vertex-picker.d.ts +0 -116
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
import { Components, Disposable, Event, Component, AsyncEvent } from "../../core";
|
|
3
|
-
import { IfcStreamingSettings, StreamedGeometries, StreamedAsset } from "./src";
|
|
4
|
-
export * from "./src";
|
|
5
|
-
/**
|
|
6
|
-
* A component that handles the tiling of IFC geometries for efficient streaming. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcGeometryTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcGeometryTiler).
|
|
7
|
-
*/
|
|
8
|
-
export declare class IfcGeometryTiler extends Component implements Disposable {
|
|
9
|
-
/**
|
|
10
|
-
* A unique identifier for the component.
|
|
11
|
-
* This UUID is used to register the component within the Components system.
|
|
12
|
-
*/
|
|
13
|
-
static readonly uuid: "d9999a00-e1f5-4d3f-8cfe-c56e08609764";
|
|
14
|
-
/**
|
|
15
|
-
* Event triggered when geometry is streamed.
|
|
16
|
-
* Contains the streamed geometry data and its buffer.
|
|
17
|
-
*/
|
|
18
|
-
readonly onGeometryStreamed: AsyncEvent<{
|
|
19
|
-
buffer: Uint8Array;
|
|
20
|
-
data: StreamedGeometries;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Event triggered when assets are streamed.
|
|
24
|
-
* Contains the streamed assets.
|
|
25
|
-
*/
|
|
26
|
-
readonly onAssetStreamed: AsyncEvent<StreamedAsset[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Event triggered to indicate the progress of the streaming process.
|
|
29
|
-
* Contains the progress percentage.
|
|
30
|
-
*/
|
|
31
|
-
readonly onProgress: AsyncEvent<number>;
|
|
32
|
-
/**
|
|
33
|
-
* Event triggered when the IFC file is loaded.
|
|
34
|
-
* Contains the loaded IFC file data.
|
|
35
|
-
*/
|
|
36
|
-
readonly onIfcLoaded: AsyncEvent<Uint8Array>;
|
|
37
|
-
/** {@link Disposable.onDisposed} */
|
|
38
|
-
readonly onDisposed: Event<unknown>;
|
|
39
|
-
/**
|
|
40
|
-
* Settings for the IfcGeometryTiler.
|
|
41
|
-
*/
|
|
42
|
-
settings: IfcStreamingSettings;
|
|
43
|
-
/** {@link Component.enabled} */
|
|
44
|
-
enabled: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The WebIFC API instance used for IFC file processing.
|
|
47
|
-
*/
|
|
48
|
-
webIfc: WEBIFC.IfcAPI;
|
|
49
|
-
private _nextAvailableID;
|
|
50
|
-
private _splittedGeometries;
|
|
51
|
-
private _spatialTree;
|
|
52
|
-
private _metaData;
|
|
53
|
-
private _visitedGeometries;
|
|
54
|
-
private _streamSerializer;
|
|
55
|
-
private _geometries;
|
|
56
|
-
private _geometryCount;
|
|
57
|
-
private _civil;
|
|
58
|
-
private _groupSerializer;
|
|
59
|
-
private _assets;
|
|
60
|
-
private _meshesWithHoles;
|
|
61
|
-
constructor(components: Components);
|
|
62
|
-
/** {@link Disposable.dispose} */
|
|
63
|
-
dispose(): void;
|
|
64
|
-
/**
|
|
65
|
-
* This method streams the IFC file from a given buffer.
|
|
66
|
-
*
|
|
67
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
68
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
69
|
-
*
|
|
70
|
-
* @remarks
|
|
71
|
-
* This method cleans up any resources after the streaming process is complete.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const ifcData = await fetch('path/to/ifc/file.ifc');
|
|
76
|
-
* const rawBuffer = await response.arrayBuffer();
|
|
77
|
-
* const ifcBuffer = new Uint8Array(rawBuffer);
|
|
78
|
-
* await ifcGeometryTiler.streamFromBuffer(ifcBuffer);
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
82
|
-
/**
|
|
83
|
-
* This method streams the IFC file from a given callback.
|
|
84
|
-
*
|
|
85
|
-
* @param loadCallback - The callback function that will be used to load the IFC file.
|
|
86
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
87
|
-
*
|
|
88
|
-
* @remarks
|
|
89
|
-
* This method cleans up any resources after the streaming process is complete.
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
92
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
93
|
-
private readIfcFile;
|
|
94
|
-
private streamIfcFile;
|
|
95
|
-
private streamAllGeometries;
|
|
96
|
-
private cleanUp;
|
|
97
|
-
private getMesh;
|
|
98
|
-
private getGeometry;
|
|
99
|
-
private streamAssets;
|
|
100
|
-
private streamGeometries;
|
|
101
|
-
private outputGeometries;
|
|
102
|
-
private registerGeometryData;
|
|
103
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A dictionary of geometries streamed from a server. Each geometry is identified by a unique number (id), and contains information about its bounding box, whether it has holes, and an optional file path for the geometry data.
|
|
3
|
-
*/
|
|
4
|
-
export interface StreamedGeometries {
|
|
5
|
-
[id: number]: {
|
|
6
|
-
/** The bounding box of the geometry as a Float32Array. */
|
|
7
|
-
boundingBox: Float32Array;
|
|
8
|
-
/** A boolean indicating whether the geometry has holes. */
|
|
9
|
-
hasHoles: boolean;
|
|
10
|
-
/** An optional file path for the geometry data. */
|
|
11
|
-
geometryFile?: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A streamed asset, which consists of multiple geometries. Each geometry in the asset is identified by a unique number (geometryID), and contains information about its transformation and color.
|
|
16
|
-
*/
|
|
17
|
-
export interface StreamedAsset {
|
|
18
|
-
/** The unique identifier of the asset. */
|
|
19
|
-
id: number;
|
|
20
|
-
/** An array of geometries associated with the asset. */
|
|
21
|
-
geometries: {
|
|
22
|
-
/** The unique identifier of the geometry. */
|
|
23
|
-
geometryID: number;
|
|
24
|
-
/** The transformation matrix of the geometry as a number array. */
|
|
25
|
-
transformation: number[];
|
|
26
|
-
/** The color of the geometry as a number array. */
|
|
27
|
-
color: number[];
|
|
28
|
-
}[];
|
|
29
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2
|
-
/**
|
|
3
|
-
* Settings for streaming IFC geometry and assets. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
4
|
-
*/
|
|
5
|
-
export declare class IfcStreamingSettings extends IfcFragmentSettings {
|
|
6
|
-
/**
|
|
7
|
-
* Minimum number of geometries to be streamed.
|
|
8
|
-
* Defaults to 10 geometries.
|
|
9
|
-
*/
|
|
10
|
-
minGeometrySize: number;
|
|
11
|
-
/**
|
|
12
|
-
* Minimum amount of assets to be streamed.
|
|
13
|
-
* Defaults to 1000 assets.
|
|
14
|
-
*/
|
|
15
|
-
minAssetsSize: number;
|
|
16
|
-
/**
|
|
17
|
-
* Maximum amount of triangles per fragment. Useful for controlling the maximum size of fragment files.
|
|
18
|
-
*/
|
|
19
|
-
maxTriangles: number | null;
|
|
20
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
3
|
-
import { IfcFragmentSettings } from "./src";
|
|
4
|
-
import { Component, Components, Event, Disposable } from "../../core";
|
|
5
|
-
export * from "./src/ifc-fragment-settings";
|
|
6
|
-
/**
|
|
7
|
-
* The IfcLoader component is responsible for loading and processing IFC files. It utilizes the Web-IFC library to handle the IFC data and the Three.js library for 3D rendering. The class provides methods for setting up, loading, and cleaning up IFC files. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcLoader). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcLoader).
|
|
8
|
-
*/
|
|
9
|
-
export declare class IfcLoader extends Component implements Disposable {
|
|
10
|
-
/**
|
|
11
|
-
* A unique identifier for the component.
|
|
12
|
-
* This UUID is used to register the component within the Components system.
|
|
13
|
-
*/
|
|
14
|
-
static readonly uuid: "a659add7-1418-4771-a0d6-7d4d438e4624";
|
|
15
|
-
/** {@link Disposable.onDisposed} */
|
|
16
|
-
readonly onDisposed: Event<string>;
|
|
17
|
-
/**
|
|
18
|
-
* An event triggered when the IFC file starts loading.
|
|
19
|
-
*/
|
|
20
|
-
readonly onIfcStartedLoading: Event<void>;
|
|
21
|
-
/**
|
|
22
|
-
* An event triggered when the setup process is completed.
|
|
23
|
-
*/
|
|
24
|
-
readonly onSetup: Event<void>;
|
|
25
|
-
/**
|
|
26
|
-
* The settings for the IfcLoader.
|
|
27
|
-
* It includes options for excluding categories, setting WASM paths, and more.
|
|
28
|
-
*/
|
|
29
|
-
settings: IfcFragmentSettings;
|
|
30
|
-
/**
|
|
31
|
-
* The instance of the Web-IFC library used for handling IFC data.
|
|
32
|
-
*/
|
|
33
|
-
webIfc: WEBIFC.IfcAPI;
|
|
34
|
-
/** {@link Component.enabled} */
|
|
35
|
-
enabled: boolean;
|
|
36
|
-
private _material;
|
|
37
|
-
private _spatialTree;
|
|
38
|
-
private _metaData;
|
|
39
|
-
private _fragmentInstances;
|
|
40
|
-
private _civil;
|
|
41
|
-
private _visitedFragments;
|
|
42
|
-
private _materialT;
|
|
43
|
-
constructor(components: Components);
|
|
44
|
-
/** {@link Disposable.dispose} */
|
|
45
|
-
dispose(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Sets up the IfcLoader component with the provided configuration.
|
|
48
|
-
*
|
|
49
|
-
* @param config - Optional configuration settings for the IfcLoader.
|
|
50
|
-
* If not provided, the existing settings will be used.
|
|
51
|
-
*
|
|
52
|
-
* @returns A Promise that resolves when the setup process is completed.
|
|
53
|
-
*
|
|
54
|
-
* @remarks
|
|
55
|
-
* If the `autoSetWasm` option is enabled in the configuration,
|
|
56
|
-
* the method will automatically set the WASM paths for the Web-IFC library.
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const ifcLoader = new IfcLoader(components);
|
|
61
|
-
* await ifcLoader.setup({ autoSetWasm: true });
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
setup(config?: Partial<IfcFragmentSettings>): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Loads an IFC file and processes it for 3D visualization.
|
|
67
|
-
*
|
|
68
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
69
|
-
* @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
|
|
70
|
-
*
|
|
71
|
-
* @returns A Promise that resolves to the FragmentsGroup containing the loaded and processed IFC data.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
76
|
-
* const group = await ifcLoader.load(ifcData);
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
load(data: Uint8Array, coordinate?: boolean, name?: string): Promise<FRAGS.FragmentsGroup>;
|
|
80
|
-
/**
|
|
81
|
-
* Reads an IFC file and initializes the Web-IFC library.
|
|
82
|
-
*
|
|
83
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
84
|
-
*
|
|
85
|
-
* @returns A Promise that resolves when the IFC file is opened and initialized.
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* This method sets the WASM path and initializes the Web-IFC library based on the provided settings.
|
|
89
|
-
* It also opens the IFC model using the provided data and settings.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
94
|
-
* await ifcLoader.readIfcFile(ifcData);
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
readIfcFile(data: Uint8Array): Promise<number>;
|
|
98
|
-
/**
|
|
99
|
-
* Cleans up the IfcLoader component by resetting the Web-IFC library,
|
|
100
|
-
* clearing the visited fragments and fragment instances maps, and creating a new instance of the Web-IFC library.
|
|
101
|
-
*
|
|
102
|
-
* @remarks
|
|
103
|
-
* This method is called automatically after using the .load() method, so usually you don't need to use it manually.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* const ifcLoader = components.get(IfcLoader);
|
|
108
|
-
* ifcLoader.cleanUp();
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
cleanUp(): void;
|
|
112
|
-
private getAllGeometries;
|
|
113
|
-
private getMesh;
|
|
114
|
-
private getGeometry;
|
|
115
|
-
private autoSetWasm;
|
|
116
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import * as WEBIFC from "web-ifc";
|
|
3
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
4
|
-
export declare class CivilReader {
|
|
5
|
-
defLineMat: THREE.LineBasicMaterial;
|
|
6
|
-
read(webIfc: WEBIFC.IfcAPI): {
|
|
7
|
-
alignments: Map<number, FRAGS.AlignmentObject>;
|
|
8
|
-
coordinationMatrix: THREE.Matrix4;
|
|
9
|
-
} | undefined;
|
|
10
|
-
get(civilItems: any): {
|
|
11
|
-
alignments: Map<number, FRAGS.AlignmentObject>;
|
|
12
|
-
coordinationMatrix: THREE.Matrix4;
|
|
13
|
-
} | undefined;
|
|
14
|
-
private getCurves;
|
|
15
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
/** Configuration of the IFC-fragment conversion. */
|
|
3
|
-
export declare class IfcFragmentSettings {
|
|
4
|
-
/** Whether to extract the IFC properties into a JSON. */
|
|
5
|
-
includeProperties: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Generate the geometry for categories that are not included by default,
|
|
8
|
-
* like IFCSPACE.
|
|
9
|
-
*/
|
|
10
|
-
optionalCategories: number[];
|
|
11
|
-
/** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
12
|
-
wasm: {
|
|
13
|
-
path: string;
|
|
14
|
-
absolute: boolean;
|
|
15
|
-
logLevel?: WEBIFC.LogLevel;
|
|
16
|
-
};
|
|
17
|
-
/** List of categories that won't be converted to fragments. */
|
|
18
|
-
excludedCategories: Set<number>;
|
|
19
|
-
/** Exclusive list of categories that will be converted to fragments. If this contains any category, any other categories will be ignored. */
|
|
20
|
-
includedCategories: Set<number>;
|
|
21
|
-
/** Whether to save the absolute location of all IFC items. */
|
|
22
|
-
saveLocations: boolean;
|
|
23
|
-
/** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
|
|
24
|
-
webIfc: WEBIFC.LoaderSettings;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to automatically set the path to the WASM file for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
27
|
-
* If set to true, the path will be set to the default path of the WASM file.
|
|
28
|
-
* If set to false, the path must be provided manually in the `wasm.path` property.
|
|
29
|
-
* Default value is true.
|
|
30
|
-
*/
|
|
31
|
-
autoSetWasm: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Custom function to handle the file location for [web-ifc](https://github.com/ThatOpen/engine_web-ifc).
|
|
34
|
-
* This function will be called when [web-ifc](https://github.com/ThatOpen/engine_web-ifc) needs to locate a file.
|
|
35
|
-
* If set to null, the default file location handler will be used.
|
|
36
|
-
*
|
|
37
|
-
* @param url - The URL of the file to locate.
|
|
38
|
-
* @returns The absolute path of the file.
|
|
39
|
-
*/
|
|
40
|
-
customLocateFileHandler: WEBIFC.LocateFileHandlerFn | null;
|
|
41
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
import * as THREE from "three";
|
|
3
|
-
export declare class Units {
|
|
4
|
-
factor: number;
|
|
5
|
-
complement: number;
|
|
6
|
-
apply(matrix: THREE.Matrix4): void;
|
|
7
|
-
setUp(webIfc: WEBIFC.IfcAPI): void;
|
|
8
|
-
private getLengthUnits;
|
|
9
|
-
private getScaleMatrix;
|
|
10
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as WEBIFC from "web-ifc";
|
|
2
|
-
import { AsyncEvent, Component, Disposable, Event } from "../../core";
|
|
3
|
-
import { PropertiesStreamingSettings } from "./src";
|
|
4
|
-
export * from "./src";
|
|
5
|
-
/**
|
|
6
|
-
* A component that converts the properties of an IFC file to tiles. It uses the Web-IFC library to read and process the IFC data. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcPropertiesTiler). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcPropertiesTiler).
|
|
7
|
-
*/
|
|
8
|
-
export declare class IfcPropertiesTiler extends Component implements Disposable {
|
|
9
|
-
/**
|
|
10
|
-
* A unique identifier for the component.
|
|
11
|
-
* This UUID is used to register the component within the Components system.
|
|
12
|
-
*/
|
|
13
|
-
static readonly uuid: "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b";
|
|
14
|
-
/**
|
|
15
|
-
* An event that is triggered when properties are streamed from the IFC file.
|
|
16
|
-
* The event provides the type of the IFC entity and the corresponding data.
|
|
17
|
-
*/
|
|
18
|
-
readonly onPropertiesStreamed: AsyncEvent<{
|
|
19
|
-
type: number;
|
|
20
|
-
data: {
|
|
21
|
-
[id: number]: any;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
/**
|
|
25
|
-
* An event that is triggered to indicate the progress of the streaming process.
|
|
26
|
-
* The event provides a number between 0 and 1 representing the progress percentage.
|
|
27
|
-
*/
|
|
28
|
-
readonly onProgress: AsyncEvent<number>;
|
|
29
|
-
/**
|
|
30
|
-
* An event that is triggered when indices are streamed from the IFC file.
|
|
31
|
-
* The event provides a map of indices, where the key is the entity type and the value is another map of indices.
|
|
32
|
-
*/
|
|
33
|
-
readonly onIndicesStreamed: AsyncEvent<Map<number, Map<number, number[]>>>;
|
|
34
|
-
/** {@link Disposable.onDisposed} */
|
|
35
|
-
readonly onDisposed: Event<string>;
|
|
36
|
-
/** {@link Component.enabled} */
|
|
37
|
-
enabled: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* An instance of the PropertiesStreamingSettings class, which holds the settings for the streaming process.
|
|
40
|
-
*/
|
|
41
|
-
settings: PropertiesStreamingSettings;
|
|
42
|
-
/**
|
|
43
|
-
* An instance of the IfcAPI class from the Web-IFC library, which provides methods for reading and processing IFC data.
|
|
44
|
-
*/
|
|
45
|
-
webIfc: WEBIFC.IfcAPI;
|
|
46
|
-
/** {@link Disposable.dispose} */
|
|
47
|
-
dispose(): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* This method converts properties from an IFC file to tiles given its data as a Uint8Array.
|
|
50
|
-
*
|
|
51
|
-
* @param data - The Uint8Array containing the IFC file data.
|
|
52
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
53
|
-
*/
|
|
54
|
-
streamFromBuffer(data: Uint8Array): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* This method converts properties from an IFC file to tiles using a given callback function to read the file.
|
|
57
|
-
*
|
|
58
|
-
* @param loadCallback - A callback function that loads the IFC file data.
|
|
59
|
-
* @returns A Promise that resolves when the streaming process is complete.
|
|
60
|
-
*/
|
|
61
|
-
streamFromCallBack(loadCallback: WEBIFC.ModelLoadCallback): Promise<void>;
|
|
62
|
-
private readIfcFile;
|
|
63
|
-
private streamIfcFile;
|
|
64
|
-
private streamAllProperties;
|
|
65
|
-
private cleanUp;
|
|
66
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./streaming-settings";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IfcFragmentSettings } from "../../IfcLoader/src";
|
|
2
|
-
/**
|
|
3
|
-
* Settings for streaming properties. Extends {@link IfcFragmentSettings} to inherit common settings.
|
|
4
|
-
*/
|
|
5
|
-
export declare class PropertiesStreamingSettings extends IfcFragmentSettings {
|
|
6
|
-
/**
|
|
7
|
-
* Amount of properties to be streamed.
|
|
8
|
-
* Defaults to 100 properties.
|
|
9
|
-
*/
|
|
10
|
-
propertiesSize: number;
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./BoundingBoxer";
|
|
2
|
-
export * from "./Classifier";
|
|
3
|
-
export * from "./Exploder";
|
|
4
|
-
export * from "./Hider";
|
|
5
|
-
export * from "./IfcLoader";
|
|
6
|
-
export * from "./FragmentsManager";
|
|
7
|
-
export * from "./IfcGeometryTiler";
|
|
8
|
-
export * from "./IfcPropertiesTiler";
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Component, Components } from "../../core";
|
|
2
|
-
import { IfcQueryGroup } from "./src/ifc-query-group";
|
|
3
|
-
import { IfcFinderQuery } from "./src";
|
|
4
|
-
export * from "./src";
|
|
5
|
-
/**
|
|
6
|
-
* Component to make text queries in the IFC.
|
|
7
|
-
*/
|
|
8
|
-
export declare class IfcFinder extends Component {
|
|
9
|
-
/**
|
|
10
|
-
* A unique identifier for the component.
|
|
11
|
-
* This UUID is used to register the component within the Components system.
|
|
12
|
-
*/
|
|
13
|
-
static readonly uuid: "0da7ad77-f734-42ca-942f-a074adfd1e3a";
|
|
14
|
-
/** {@link Component.enabled} */
|
|
15
|
-
enabled: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* List of all created {@link IfcQueryGroup} instances.
|
|
18
|
-
*/
|
|
19
|
-
list: Map<string, IfcQueryGroup>;
|
|
20
|
-
/**
|
|
21
|
-
* List of all queries from all created {@link IfcQueryGroup} instances.
|
|
22
|
-
*/
|
|
23
|
-
get queries(): Set<IfcFinderQuery>;
|
|
24
|
-
constructor(components: Components);
|
|
25
|
-
/**
|
|
26
|
-
* Imports all the query groups provided in the given data. You can generate this data to save the result of queries and persist it over time.
|
|
27
|
-
* @param data The data containing the serialized query groups to import.
|
|
28
|
-
*/
|
|
29
|
-
import(data: {
|
|
30
|
-
[groupID: string]: any;
|
|
31
|
-
}): void;
|
|
32
|
-
/**
|
|
33
|
-
* Exports all the query groups created. You can then import this data back using the import method.
|
|
34
|
-
*/
|
|
35
|
-
export(): {
|
|
36
|
-
[groupID: string]: any;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Creates a new {@link IfcQueryGroup}.
|
|
40
|
-
*/
|
|
41
|
-
create(): IfcQueryGroup;
|
|
42
|
-
/**
|
|
43
|
-
* Creates the {@link IfcQueryGroup} with the given ID.
|
|
44
|
-
*/
|
|
45
|
-
delete(id: string): void;
|
|
46
|
-
/**
|
|
47
|
-
* Deletes all {@link IfcQueryGroup} instances.
|
|
48
|
-
*/
|
|
49
|
-
clear(): void;
|
|
50
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
-
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
3
|
-
import { IfcFinderQuery } from "./ifc-finder-query";
|
|
4
|
-
import { Components } from "../../../core";
|
|
5
|
-
/**
|
|
6
|
-
* A query that checks the direct attributes of IFC items.
|
|
7
|
-
*/
|
|
8
|
-
export declare class IfcBasicQuery extends IfcFinderQuery {
|
|
9
|
-
/**
|
|
10
|
-
* {@link IfcFinderQuery.name}
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
13
|
-
/**
|
|
14
|
-
* The type of this query.
|
|
15
|
-
*/
|
|
16
|
-
static type: "IfcBasicQuery";
|
|
17
|
-
/**
|
|
18
|
-
* {@link IfcFinderQuery.items}
|
|
19
|
-
*/
|
|
20
|
-
get items(): FRAGS.FragmentIdMap;
|
|
21
|
-
constructor(components: Components, data: {
|
|
22
|
-
name: string;
|
|
23
|
-
rules: IfcFinderRule[];
|
|
24
|
-
inclusive: boolean;
|
|
25
|
-
});
|
|
26
|
-
/**
|
|
27
|
-
* {@link IfcFinderQuery.export}
|
|
28
|
-
*/
|
|
29
|
-
export(): SerializedQuery;
|
|
30
|
-
/**
|
|
31
|
-
* {@link IfcFinderQuery.update}
|
|
32
|
-
*/
|
|
33
|
-
update(modelID: string, file: File): Promise<void>;
|
|
34
|
-
protected findInLines(modelID: string, lines: string[]): void;
|
|
35
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
2
|
-
import { IfcFinderRule, SerializedQuery } from "./types";
|
|
3
|
-
import { Components, Event } from "../../../core";
|
|
4
|
-
/**
|
|
5
|
-
* The base class for all queries used by the {@link IfcFinder}.
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class IfcFinderQuery {
|
|
8
|
-
/**
|
|
9
|
-
* The list of functions to import the queries. If you create your own custom query, you should add its importer here. See the other queries provided by the library for reference.
|
|
10
|
-
*/
|
|
11
|
-
static importers: Map<string, (components: Components, data: any) => IfcFinderQuery>;
|
|
12
|
-
/**
|
|
13
|
-
* Event used to notify the progress when performing a query on an IFC file.
|
|
14
|
-
*/
|
|
15
|
-
readonly onProgress: Event<number>;
|
|
16
|
-
/**
|
|
17
|
-
* A name given to the instance of the query to identify it.
|
|
18
|
-
*/
|
|
19
|
-
abstract name: string;
|
|
20
|
-
/**
|
|
21
|
-
* The list of IFC items that this query found across all models.
|
|
22
|
-
*/
|
|
23
|
-
abstract items: FRAGS.FragmentIdMap;
|
|
24
|
-
/**
|
|
25
|
-
* If false, ALL rules of the query must comply to make a match. If true, ANY rule will be enough to make a match.
|
|
26
|
-
*/
|
|
27
|
-
inclusive: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* The list of rules to be applied by this query.
|
|
30
|
-
*/
|
|
31
|
-
rules: IfcFinderRule[];
|
|
32
|
-
/**
|
|
33
|
-
* The IDs of the match items per model.
|
|
34
|
-
*/
|
|
35
|
-
ids: {
|
|
36
|
-
[modelID: string]: Set<number>;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Whether this query is up to date or not per file. If not, when updating the group where it belongs, it will re-process the given file.
|
|
40
|
-
*/
|
|
41
|
-
needsUpdate: Map<string, boolean>;
|
|
42
|
-
/**
|
|
43
|
-
* Export the current data of this query in a serializable object to persist it over time.
|
|
44
|
-
*/
|
|
45
|
-
abstract export(): {
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Perform the search in the given file and save the result.
|
|
50
|
-
*/
|
|
51
|
-
abstract update(modelID: string, file: File): Promise<void>;
|
|
52
|
-
protected components: Components;
|
|
53
|
-
protected abstract findInLines(modelID: string, lines: string[]): void;
|
|
54
|
-
protected constructor(components: Components);
|
|
55
|
-
/**
|
|
56
|
-
* Imports a query given its data. This data can be generating using its {@link IfcFinderQuery.export} method.
|
|
57
|
-
*
|
|
58
|
-
* @param components the instance of {@link Components} used by this app.
|
|
59
|
-
* @param data the data of the query to import as a serializable object.
|
|
60
|
-
*/
|
|
61
|
-
static import(components: Components, data: {
|
|
62
|
-
[id: string]: any;
|
|
63
|
-
}): IfcFinderQuery | null;
|
|
64
|
-
/**
|
|
65
|
-
* Imports the given serialized rules. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
66
|
-
*
|
|
67
|
-
* @param serializedRules the rules to be parsed.
|
|
68
|
-
*/
|
|
69
|
-
static importRules(serializedRules: {
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
}[]): IfcFinderRule[];
|
|
72
|
-
/**
|
|
73
|
-
* Imports the given IDs. Only use this when writing your own custom query. See the other queries provided by the library for reference.
|
|
74
|
-
*
|
|
75
|
-
* @param data the serialized object representing the query whose IDs to parse.
|
|
76
|
-
*/
|
|
77
|
-
static importIds(data: SerializedQuery): {
|
|
78
|
-
[modelID: string]: Set<number>;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Clears the data of the given model. If not specified, clears all the data.
|
|
82
|
-
*
|
|
83
|
-
* @param modelID ID of the model whose data to clear.
|
|
84
|
-
*/
|
|
85
|
-
clear(modelID?: string): void;
|
|
86
|
-
protected addID(modelID: string, id: number): void;
|
|
87
|
-
protected getData(): SerializedQuery;
|
|
88
|
-
protected exportRules(): {
|
|
89
|
-
[key: string]: any;
|
|
90
|
-
}[];
|
|
91
|
-
protected findInFile(modelID: string, file: File): Promise<void>;
|
|
92
|
-
protected getIdFromLine(line: string): number;
|
|
93
|
-
protected testRules(line: string): boolean;
|
|
94
|
-
protected getCategoryFromLine(line: string): string | null;
|
|
95
|
-
protected getAttributesFromLine(line: string): string[] | null;
|
|
96
|
-
}
|