@thatopen/components 2.4.11 → 3.1.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.
Files changed (161) hide show
  1. package/dist/index.cjs +18440 -25937
  2. package/dist/index.d.ts +4530 -6
  3. package/dist/index.min.cjs +3 -3
  4. package/dist/index.min.mjs +3 -3
  5. package/dist/index.mjs +18442 -25939
  6. package/package.json +8 -10
  7. package/dist/core/Clipper/index.d.ts +0 -142
  8. package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
  9. package/dist/core/Clipper/src/index.d.ts +0 -1
  10. package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
  11. package/dist/core/Components/index.d.ts +0 -93
  12. package/dist/core/ConfigManager/index.d.ts +0 -21
  13. package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
  14. package/dist/core/ConfigManager/src/index.d.ts +0 -1
  15. package/dist/core/Cullers/index.d.ts +0 -56
  16. package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
  17. package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
  18. package/dist/core/Cullers/src/index.d.ts +0 -3
  19. package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
  20. package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
  21. package/dist/core/Disposer/index.d.ts +0 -45
  22. package/dist/core/Grids/index.d.ts +0 -46
  23. package/dist/core/Grids/src/index.d.ts +0 -2
  24. package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
  25. package/dist/core/Grids/src/simple-grid.d.ts +0 -48
  26. package/dist/core/MiniMap/index.d.ts +0 -50
  27. package/dist/core/MiniMap/src/index.d.ts +0 -2
  28. package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
  29. package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
  30. package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
  31. package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
  32. package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
  33. package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
  34. package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
  35. package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
  36. package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
  37. package/dist/core/Raycasters/index.d.ts +0 -43
  38. package/dist/core/Raycasters/src/index.d.ts +0 -2
  39. package/dist/core/Raycasters/src/mouse.d.ts +0 -24
  40. package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
  41. package/dist/core/ShadowedScene/index.d.ts +0 -57
  42. package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
  43. package/dist/core/ShadowedScene/src/index.d.ts +0 -1
  44. package/dist/core/Types/index.d.ts +0 -1
  45. package/dist/core/Types/src/async-event.d.ts +0 -32
  46. package/dist/core/Types/src/base-camera.d.ts +0 -28
  47. package/dist/core/Types/src/base-renderer.d.ts +0 -65
  48. package/dist/core/Types/src/base-scene.d.ts +0 -25
  49. package/dist/core/Types/src/base-world-item.d.ts +0 -23
  50. package/dist/core/Types/src/base.d.ts +0 -19
  51. package/dist/core/Types/src/component-with-ui.d.ts +0 -18
  52. package/dist/core/Types/src/component.d.ts +0 -13
  53. package/dist/core/Types/src/config-types.d.ts +0 -47
  54. package/dist/core/Types/src/data-map.d.ts +0 -73
  55. package/dist/core/Types/src/data-set.d.ts +0 -58
  56. package/dist/core/Types/src/event-manager.d.ts +0 -30
  57. package/dist/core/Types/src/event.d.ts +0 -32
  58. package/dist/core/Types/src/index.d.ts +0 -15
  59. package/dist/core/Types/src/interfaces.d.ts +0 -117
  60. package/dist/core/Types/src/world.d.ts +0 -34
  61. package/dist/core/Viewpoints/index.d.ts +0 -38
  62. package/dist/core/Viewpoints/src/index.d.ts +0 -2
  63. package/dist/core/Viewpoints/src/types.d.ts +0 -36
  64. package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
  65. package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
  66. package/dist/core/Worlds/index.d.ts +0 -54
  67. package/dist/core/Worlds/src/index.d.ts +0 -5
  68. package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
  69. package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
  70. package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
  71. package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
  72. package/dist/core/Worlds/src/simple-world.d.ts +0 -79
  73. package/dist/core/index.d.ts +0 -13
  74. package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
  75. package/dist/fragments/Classifier/index.d.ts +0 -197
  76. package/dist/fragments/Exploder/index.d.ts +0 -50
  77. package/dist/fragments/FragmentsManager/index.d.ts +0 -152
  78. package/dist/fragments/Hider/index.d.ts +0 -38
  79. package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
  80. package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
  81. package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
  82. package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
  83. package/dist/fragments/IfcLoader/index.d.ts +0 -116
  84. package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
  85. package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
  86. package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
  87. package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
  88. package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
  89. package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
  90. package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
  91. package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
  92. package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
  93. package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
  94. package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
  95. package/dist/fragments/index.d.ts +0 -8
  96. package/dist/ifc/IfcFinder/index.d.ts +0 -50
  97. package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
  98. package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
  99. package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
  100. package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
  101. package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
  102. package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
  103. package/dist/ifc/IfcIsolator/index.d.ts +0 -24
  104. package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
  105. package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
  106. package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
  107. package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
  108. package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
  109. package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
  110. package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
  111. package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
  112. package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
  113. package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
  114. package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
  115. package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
  116. package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
  117. package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
  118. package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
  119. package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
  120. package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
  121. package/dist/ifc/Utils/index.d.ts +0 -5
  122. package/dist/ifc/Utils/properties-utils.d.ts +0 -25
  123. package/dist/ifc/index.d.ts +0 -6
  124. package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
  125. package/dist/measurement/index.d.ts +0 -1
  126. package/dist/namespace.d.ts +0 -6018
  127. package/dist/openbim/BCFTopics/index.d.ts +0 -114
  128. package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
  129. package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
  130. package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
  131. package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
  132. package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
  133. package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
  134. package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
  135. package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
  136. package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
  137. package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
  138. package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
  139. package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
  140. package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
  141. package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
  142. package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
  143. package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
  144. package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
  145. package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
  146. package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
  147. package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
  148. package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
  149. package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
  150. package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
  151. package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
  152. package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
  153. package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
  154. package/dist/openbim/index.d.ts +0 -2
  155. package/dist/utils/bbox.d.ts +0 -7
  156. package/dist/utils/geometry.d.ts +0 -1
  157. package/dist/utils/index.d.ts +0 -6
  158. package/dist/utils/materials.d.ts +0 -4
  159. package/dist/utils/section-generator.d.ts +0 -31
  160. package/dist/utils/uuid.d.ts +0 -6
  161. package/dist/utils/vertex-picker.d.ts +0 -116
@@ -1,84 +0,0 @@
1
- /**
2
- * A rule for the {@link IfcFinder} to search items based on their category.
3
- */
4
- export interface IfcCategoryRule {
5
- /**
6
- * The type of this rule. All rules have a fixed type.
7
- */
8
- type: "category";
9
- /**
10
- * The category value. It's a regular expression, so you can make complex queries and use ".*" to match all categories.
11
- */
12
- value: RegExp;
13
- }
14
- /**
15
- * A rule for the {@link IfcFinder} to search items based on the properties defined in their property sets.
16
- */
17
- export interface IfcPropertyRule {
18
- /**
19
- * The type of this rule. All rules have a fixed type.
20
- */
21
- type: "property";
22
- /**
23
- * The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
24
- */
25
- name: RegExp;
26
- /**
27
- * The value of the property. It's a regular expression, so you can make complex queries and use ".*" to match all values.
28
- */
29
- value: RegExp;
30
- }
31
- /**
32
- * A rule for the {@link IfcFinder} to search items based on the value of a numeric property defined in their property sets.
33
- */
34
- export interface IfcOperatorRule {
35
- /**
36
- * The type of this rule. All rules have a fixed type.
37
- */
38
- type: "operator";
39
- /**
40
- * The name of the property. It's a regular expression, so you can make complex queries and use ".*" to match all names.
41
- */
42
- name: RegExp;
43
- /**
44
- * The value of the property.
45
- */
46
- value: number;
47
- /**
48
- * The operator to apply to the numeric value.
49
- */
50
- operator: "<" | ">" | "=" | "<=" | ">=";
51
- }
52
- /**
53
- * The type of rules that can be used in the queries of the {@link IfcFinder}.
54
- */
55
- export type IfcFinderRule = IfcCategoryRule | IfcPropertyRule | IfcOperatorRule;
56
- /**
57
- * The data type used when the queries of the {@link IfcFinder} export or import query data to persist it.
58
- */
59
- export type SerializedQuery = {
60
- /**
61
- * {@link IfcFinderQuery.name}
62
- */
63
- name: string;
64
- /**
65
- * {@link IfcFinderQuery.inclusive}
66
- */
67
- inclusive: boolean;
68
- /**
69
- * The type of query.
70
- */
71
- type: string;
72
- /**
73
- * {@link IfcFinderQuery.ids}
74
- */
75
- ids: {
76
- [modelID: string]: number[];
77
- };
78
- /**
79
- * {@link IfcFinderQuery.rules}
80
- */
81
- rules: {
82
- [key: string]: any;
83
- }[];
84
- };
@@ -1,24 +0,0 @@
1
- import * as WEBIFC from "web-ifc";
2
- import { Component, Components } from "../../core";
3
- /**
4
- * Component to isolate certain elements from an IFC and export to another IFC. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcIsolator). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcIsolator).
5
- */
6
- export declare class IfcIsolator extends Component {
7
- /**
8
- * A unique identifier for the component.
9
- * This UUID is used to register the component within the Components system.
10
- */
11
- static readonly uuid: "6eb0ba2f-71c0-464e-bcec-2d7c335186b2";
12
- /** {@link Component.enabled} */
13
- enabled: boolean;
14
- constructor(components: Components);
15
- getIsolatedElements(webIfc: WEBIFC.IfcAPI, modelID: number, elementIDs: Array<number>): Promise<any[]>;
16
- /**
17
- * Exports isolated elements to the new model.
18
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
19
- * @param modelID ID of the new IFC model.
20
- * @param isolatedElements The array of isolated elements
21
- */
22
- export(webIfc: WEBIFC.IfcAPI, modelID: number, isolatedElements: Array<any>): Promise<Uint8Array>;
23
- splitIfc(webIfc: WEBIFC.IfcAPI, ifcFile: ArrayBuffer, idsToExtract: Array<number>): Promise<Uint8Array>;
24
- }
@@ -1,26 +0,0 @@
1
- import * as WEBIFC from "web-ifc";
2
- import * as FRAG from "@thatopen/fragments";
3
- import { Component, Components } from "../../core";
4
- export * from "./src";
5
- /**
6
- * Component to export all the properties from an IFC to a JS object. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcJsonExporter). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcJsonExporter).
7
- */
8
- export declare class IfcJsonExporter 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: "b32c4332-cd67-436e-ba7f-196646c7a635";
14
- /** {@link Component.enabled} */
15
- enabled: boolean;
16
- constructor(components: Components);
17
- /**
18
- * Exports all the properties of an IFC into an array of JS objects.
19
- * @param webIfc The instance of [web-ifc](https://github.com/ThatOpen/engine_web-ifc) to use.
20
- * @param modelID ID of the IFC model whose properties to extract.
21
- * @param indirect whether to get the indirect relationships as well.
22
- * @param recursiveSpatial whether to get the properties of spatial items recursively
23
- * to make the location data available (e.g. absolute position of building).
24
- */
25
- export(webIfc: WEBIFC.IfcAPI, modelID: number, indirect?: boolean, recursiveSpatial?: boolean): Promise<FRAG.IfcProperties>;
26
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * A Set of unique numbers representing different types of IFC geometries.
3
- */
4
- export declare const GeometryTypes: Set<number>;
@@ -1 +0,0 @@
1
- export * from "./ifc-geometry-types";
@@ -1,289 +0,0 @@
1
- import * as WEBIFC from "web-ifc";
2
- import { FragmentsGroup } from "@thatopen/fragments";
3
- import { Component, Disposable, Event, Components } from "../../core";
4
- import { IfcRelation } from "../IfcRelationsIndexer";
5
- /**
6
- * Types for boolean properties in IFC schema.
7
- */
8
- export type BooleanPropTypes = "IfcBoolean" | "IfcLogical";
9
- /**
10
- * Types for string properties in IFC schema.
11
- */
12
- export type StringPropTypes = "IfcText" | "IfcLabel" | "IfcIdentifier";
13
- /**
14
- * Types for numeric properties in IFC schema.
15
- */
16
- export type NumericPropTypes = "IfcInteger" | "IfcReal";
17
- /**
18
- * Interface representing a map of changed entities in a model. The keys are model UUIDs, and the values are sets of express IDs of changed entities.
19
- */
20
- export interface ChangeMap {
21
- [modelID: string]: Set<number>;
22
- }
23
- /**
24
- * Interface representing a map of attribute listeners. The keys are model UUIDs, and the values are objects with express IDs as keys, and objects with attribute names as keys, and Event objects as values.
25
- */
26
- export interface AttributeListener {
27
- [modelID: string]: {
28
- [expressID: number]: {
29
- [attributeName: string]: Event<String | Boolean | Number>;
30
- };
31
- };
32
- }
33
- /**
34
- * Component to manage and edit properties and Psets in IFC files.
35
- */
36
- export declare class IfcPropertiesManager extends Component implements Disposable {
37
- /**
38
- * A unique identifier for the component.
39
- * This UUID is used to register the component within the Components system.
40
- */
41
- static readonly uuid: "58c2d9f0-183c-48d6-a402-dfcf5b9a34df";
42
- /** {@link Disposable.onDisposed} */
43
- readonly onDisposed: Event<string>;
44
- /**
45
- * Event triggered when a file is requested for export.
46
- */
47
- readonly onRequestFile: Event<unknown>;
48
- /**
49
- * ArrayBuffer containing the IFC data to be exported.
50
- */
51
- ifcToExport: ArrayBuffer | null;
52
- /**
53
- * Event triggered when an element is added to a Pset.
54
- */
55
- readonly onElementToPset: Event<{
56
- model: FragmentsGroup;
57
- psetID: number;
58
- elementID: number;
59
- }>;
60
- /**
61
- * Event triggered when a property is added to a Pset.
62
- */
63
- readonly onPropToPset: Event<{
64
- model: FragmentsGroup;
65
- psetID: number;
66
- propID: number;
67
- }>;
68
- /**
69
- * Event triggered when a Pset is removed.
70
- */
71
- readonly onPsetRemoved: Event<{
72
- model: FragmentsGroup;
73
- psetID: number;
74
- }>;
75
- /**
76
- * Event triggered when data in the model changes.
77
- */
78
- readonly onDataChanged: Event<{
79
- model: FragmentsGroup;
80
- expressID: number;
81
- }>;
82
- /**
83
- * Configuration for the WebAssembly module.
84
- */
85
- wasm: {
86
- path: string;
87
- absolute: boolean;
88
- };
89
- /** {@link Component.enabled} */
90
- enabled: boolean;
91
- /**
92
- * Map of attribute listeners.
93
- */
94
- attributeListeners: AttributeListener;
95
- /**
96
- * The currently selected model.
97
- */
98
- selectedModel?: FragmentsGroup;
99
- /**
100
- * Map of changed entities in the model.
101
- */
102
- changeMap: ChangeMap;
103
- constructor(components: Components);
104
- /** {@link Disposable.dispose} */
105
- dispose(): void;
106
- /**
107
- * Static method to retrieve the IFC schema from a given model.
108
- *
109
- * @param model - The FragmentsGroup model from which to retrieve the IFC schema.
110
- * @throws Will throw an error if the IFC schema is not found in the model.
111
- * @returns The IFC schema associated with the given model.
112
- */
113
- static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
114
- /**
115
- * Method to add or update entity attributes in the model.
116
- *
117
- * @param model - The FragmentsGroup model in which to set the properties.
118
- * @param dataToSave - An array of objects representing the properties to be saved.
119
- * Each object must have an `expressID` property, which is the express ID of the entity in the model.
120
- * The rest of the properties will be set as the properties of the entity.
121
- *
122
- * @returns A promise that resolves when all the properties have been set.
123
- *
124
- * @throws Will throw an error if any of the `expressID` properties are missing in the `dataToSave` array.
125
- */
126
- setData(model: FragmentsGroup, ...dataToSave: Record<string, any>[]): Promise<void>;
127
- /**
128
- * Creates a new Property Set (Pset) in the given model.
129
- *
130
- * @param model - The FragmentsGroup model in which to create the Pset.
131
- * @param name - The name of the Pset.
132
- * @param description - (Optional) The description of the Pset.
133
- *
134
- * @returns A promise that resolves with an object containing the newly created Pset and its relation.
135
- *
136
- * @throws Will throw an error if the IFC schema is not found in the model.
137
- * @throws Will throw an error if no OwnerHistory is found in the model.
138
- */
139
- newPset(model: FragmentsGroup, name: string, description?: string): Promise<{
140
- pset: WEBIFC.IFC4.IfcPropertySet | WEBIFC.IFC2X3.IfcPropertySet | WEBIFC.IFC4X3.IfcPropertySet;
141
- }>;
142
- /**
143
- * Removes a Property Set (Pset) from the given model.
144
- *
145
- * @param model - The FragmentsGroup model from which to remove the Pset.
146
- * @param psetID - The express IDs of the Psets to be removed.
147
- *
148
- * @returns A promise that resolves when all the Psets have been removed.
149
- *
150
- * @throws Will throw an error if any of the `expressID` properties are missing in the `psetID` array.
151
- * @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
152
- * @throws Will throw an error if no relation is found between the Pset and the model.
153
- */
154
- removePset(model: FragmentsGroup, ...psetID: number[]): Promise<void>;
155
- /**
156
- * Creates a new single-value property of type string in the given model.
157
- *
158
- * @param model - The FragmentsGroup model in which to create the property.
159
- * @param type - The type of the property value. Must be a string property type.
160
- * @param name - The name of the property.
161
- * @param value - The value of the property. Must be a string.
162
- *
163
- * @returns The newly created single-value property.
164
- *
165
- * @throws Will throw an error if the IFC schema is not found in the model.
166
- * @throws Will throw an error if no OwnerHistory is found in the model.
167
- */
168
- newSingleStringProperty(model: FragmentsGroup, type: StringPropTypes, name: string, value: string): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
169
- /**
170
- * Creates a new single-value property of type numeric in the given model.
171
- *
172
- * @param model - The FragmentsGroup model in which to create the property.
173
- * @param type - The type of the property value. Must be a numeric property type.
174
- * @param name - The name of the property.
175
- * @param value - The value of the property. Must be a number.
176
- *
177
- * @returns The newly created single-value property.
178
- *
179
- * @throws Will throw an error if the IFC schema is not found in the model.
180
- * @throws Will throw an error if no OwnerHistory is found in the model.
181
- */
182
- newSingleNumericProperty(model: FragmentsGroup, type: NumericPropTypes, name: string, value: number): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
183
- /**
184
- * Creates a new single-value property of type boolean in the given model.
185
- *
186
- * @param model - The FragmentsGroup model in which to create the property.
187
- * @param type - The type of the property value. Must be a boolean property type.
188
- * @param name - The name of the property.
189
- * @param value - The value of the property. Must be a boolean.
190
- *
191
- * @returns The newly created single-value property.
192
- *
193
- * @throws Will throw an error if the IFC schema is not found in the model.
194
- * @throws Will throw an error if no OwnerHistory is found in the model.
195
- */
196
- newSingleBooleanProperty(model: FragmentsGroup, type: BooleanPropTypes, name: string, value: boolean): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
197
- /**
198
- * Removes a property from a Property Set (Pset) in the given model.
199
- *
200
- * @param model - The FragmentsGroup model from which to remove the property.
201
- * @param psetID - The express ID of the Pset from which to remove the property.
202
- * @param propID - The express ID of the property to be removed.
203
- *
204
- * @returns A promise that resolves when the property has been removed.
205
- *
206
- * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
207
- * @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
208
- */
209
- removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
210
- /**
211
- * @deprecated Use indexer.addEntitiesRelation instead. This will be removed in future releases.
212
- */
213
- addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): void;
214
- /**
215
- * Adds elements to a Property Set (Pset) in the given model.
216
- *
217
- * @param model - The FragmentsGroup model in which to add the elements.
218
- * @param psetID - The express ID of the Pset to which to add the elements.
219
- * @param elementID - The express IDs of the elements to be added.
220
- *
221
- * @returns A promise that resolves when all the elements have been added.
222
- *
223
- * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
224
- * @throws Will throw an error if the Pset to be added to is not of type `IFCPROPERTYSET`.
225
- * @throws Will throw an error if no relation is found between the Pset and the model.
226
- */
227
- addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
228
- /**
229
- * Creates a new instance of a relationship between entities in the IFC model.
230
- *
231
- * @param model - The FragmentsGroup model in which to create the relationship.
232
- * @param type - The type of the relationship to create.
233
- * @param relatingID - The express ID of the entity that is related to the other entities.
234
- * @param relatedIDs - The express IDs of the entities that are related to the relating entity.
235
- *
236
- * @returns A promise that resolves with the newly created relationship.
237
- *
238
- * @throws Will throw an error if the relationship type is unsupported.
239
- */
240
- createIfcRel(model: FragmentsGroup, type: IfcRelation, relatingID: number, relatedIDs: number[]): Promise<any>;
241
- /**
242
- * Saves the changes made to the model to a new IFC file.
243
- *
244
- * @param model - The FragmentsGroup model from which to save the changes.
245
- * @param ifcToSaveOn - The Uint8Array representing the original IFC file.
246
- *
247
- * @returns A promise that resolves with the modified IFC data as a Uint8Array.
248
- *
249
- * @throws Will throw an error if any issues occur during the saving process.
250
- */
251
- saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
252
- /**
253
- * Retrieves all the entities of a specific type from the model and returns their express IDs wrapped in Handles.
254
- * This is used to make references of an entity inside another entity attributes.
255
- *
256
- * @param model - The FragmentsGroup model from which to retrieve the entities.
257
- * @param type - The type of the entities to retrieve. This should be the express ID of the IFC type.
258
- *
259
- * @returns A promise that resolves with an array of Handles, each containing the express ID of an entity of the specified type.
260
- * @returns null if the model doesn't have any entity of that type
261
- */
262
- getEntityRef(model: FragmentsGroup, type: number): Promise<WEBIFC.Handle<unknown>[] | null>;
263
- /**
264
- * Sets an attribute listener for a specific attribute of an entity in the model.
265
- * The listener will trigger an event whenever the attribute's value changes.
266
- *
267
- * @param model - The FragmentsGroup model in which to set the attribute listener.
268
- * @param expressID - The express ID of the entity for which to set the listener.
269
- * @param attributeName - The name of the attribute for which to set the listener.
270
- *
271
- * @returns The event that will be triggered when the attribute's value changes.
272
- *
273
- * @throws Will throw an error if the entity with the given expressID doesn't exist.
274
- * @throws Will throw an error if the attribute is an array or null, and it can't have a listener.
275
- * @throws Will throw an error if the attribute has a badly defined handle.
276
- */
277
- setAttributeListener(model: FragmentsGroup, expressID: number, attributeName: string): Promise<Event<String | Number | Boolean>>;
278
- private getNewExpressID;
279
- private newGUID;
280
- getOwnerHistory(model: FragmentsGroup): Promise<{
281
- entity: {
282
- [attribute: string]: any;
283
- };
284
- handle: WEBIFC.Handle<unknown>;
285
- }>;
286
- registerChange(model: FragmentsGroup, ...expressID: number[]): void;
287
- newSingleProperty(model: FragmentsGroup, type: string, name: string, value: string | number | boolean): Promise<WEBIFC.IFC4.IfcPropertySingleValue | WEBIFC.IFC2X3.IfcPropertySingleValue | WEBIFC.IFC4X3.IfcPropertySingleValue>;
288
- }
289
- export * from "./src";
@@ -1,3 +0,0 @@
1
- export * from "./rel-attrs";
2
- export * from "./rel-names";
3
- export * from "./types";
@@ -1,7 +0,0 @@
1
- import { IfcRelName } from "./types";
2
- type IfcRelAttributePosition = {
3
- related: number;
4
- relating: number;
5
- };
6
- export declare const ifcRelAttrsPosition: Record<IfcRelName, IfcRelAttributePosition>;
7
- export {};
@@ -1,3 +0,0 @@
1
- import { IfcRelName } from "./types";
2
- import { IfcRelation } from "../../IfcRelationsIndexer";
3
- export declare const ifcRelClassNames: Record<IfcRelation, IfcRelName>;
@@ -1,18 +0,0 @@
1
- export type IfcRelationNames = [
2
- "IfcRelAssignsToControl",
3
- "IfcRelAssignsToGroup",
4
- "IfcRelAssignsToProduct",
5
- "IfcRelAssociatesClassification",
6
- "IfcRelAssociatesMaterial",
7
- "IfcRelAssociatesDocument",
8
- "IfcRelContainedInSpatialStructure",
9
- "IfcRelFlowControlElements",
10
- "IfcRelConnectsElements",
11
- "IfcRelDeclares",
12
- "IfcRelAggregates",
13
- "IfcRelNests",
14
- "IfcRelDefinesByProperties",
15
- "IfcRelDefinesByType",
16
- "IfcRelDefinesByTemplate"
17
- ];
18
- export type IfcRelName = IfcRelationNames[number];
@@ -1,195 +0,0 @@
1
- import * as WEBIFC from "web-ifc";
2
- import { FragmentsGroup } from "@thatopen/fragments";
3
- import { Disposable, Event, Component, Components } from "../../core";
4
- import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation, RelationsProcessingConfig, EntitiesRelatedEvent } from "./src";
5
- /**
6
- * Indexer component for IFC entities, facilitating the indexing and retrieval of IFC entity relationships. It is designed to process models properties by indexing their IFC entities' relations based on predefined inverse attributes, and provides methods to query these relations. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/IfcRelationsIndexer). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/IfcRelationsIndexer).
7
- */
8
- export declare class IfcRelationsIndexer 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: "23a889ab-83b3-44a4-8bee-ead83438370b";
14
- /** {@link Disposable.onDisposed} */
15
- readonly onDisposed: Event<string>;
16
- /**
17
- * Event triggered when relations for a model have been indexed.
18
- * This event provides the model's UUID and the relations map generated for that model.
19
- *
20
- * @property {string} modelID - The UUID of the model for which relations have been indexed.
21
- * @property {RelationsMap} relationsMap - The relations map generated for the specified model.
22
- * 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.
23
- */
24
- readonly onRelationsIndexed: Event<{
25
- modelID: string;
26
- relationsMap: RelationsMap;
27
- }>;
28
- /**
29
- * Holds the relationship mappings for each model processed by the indexer.
30
- * The structure is a map where each key is a model's UUID, and the value is another map.
31
- * This inner map's keys are entity expressIDs, and its values are maps where each key is an index
32
- * representing a specific relation type, and the value is an array of expressIDs of entities
33
- * that are related through that relation type. This structure allows for efficient querying
34
- * of entity relationships within a model.
35
- */
36
- readonly relationMaps: ModelsRelationMap;
37
- /** {@link Component.enabled} */
38
- enabled: boolean;
39
- private _relToAttributesMap;
40
- private _inverseAttributes;
41
- private _ifcRels;
42
- constructor(components: Components);
43
- private onFragmentsDisposed;
44
- private indexRelations;
45
- getAttributeIndex(inverseAttribute: InverseAttribute): number;
46
- /**
47
- * Adds a relation map to the model's relations map.
48
- *
49
- * @param model - The `FragmentsGroup` model to which the relation map will be added.
50
- * @param relationMap - The `RelationsMap` to be added to the model's relations map.
51
- *
52
- * @fires onRelationsIndexed - Triggers an event with the model's UUID and the added relation map.
53
- */
54
- setRelationMap(model: FragmentsGroup, relationMap: RelationsMap): void;
55
- /**
56
- * Processes a given model to index its IFC entities relations based on predefined inverse attributes.
57
- * This method iterates through each specified inverse attribute, retrieves the corresponding relations,
58
- * and maps them in a structured way to facilitate quick access to related entities.
59
- *
60
- * The process involves querying the model for each relation type associated with the inverse attributes
61
- * and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID
62
- * and contains a nested map where each key is an entity's expressID and its value is another map.
63
- * This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs
64
- * of entities that are related through that attribute.
65
- *
66
- * @param model The `FragmentsGroup` model to be processed. It must have properties loaded.
67
- * @returns A promise that resolves to the relations map for the processed model. This map is a detailed
68
- * representation of the relations indexed by entity expressIDs and relation types.
69
- * @throws An error if the model does not have properties loaded.
70
- */
71
- process(model: FragmentsGroup, config?: Partial<RelationsProcessingConfig>): Promise<RelationsMap>;
72
- /**
73
- * Processes a given model from a WebIfc API to index its IFC entities relations.
74
- *
75
- * @param ifcApi - The WebIfc API instance from which to retrieve the model's properties.
76
- * @param modelID - The unique identifier of the model within the WebIfc API.
77
- * @returns A promise that resolves to the relations map for the processed model.
78
- * This map is a detailed representation of the relations indexed by entity expressIDs and relation types.
79
- */
80
- processFromWebIfc(ifcApi: WEBIFC.IfcAPI, modelID: number): Promise<RelationsMap>;
81
- /**
82
- * Retrieves the relations of a specific entity within a model based on the given relation name.
83
- * This method searches the indexed relation maps for the specified model and entity,
84
- * returning the IDs of related entities if a match is found.
85
- *
86
- * @param model The `FragmentsGroup` model containing the entity, or its UUID.
87
- * @param expressID The unique identifier of the entity within the model.
88
- * @param attribute The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
89
- * @returns An array of express IDs representing the related entities. If the array is empty, no relations were found.
90
- */
91
- getEntityRelations(model: FragmentsGroup | string | RelationsMap, expressID: number, attribute: InverseAttribute): number[];
92
- /**
93
- * Serializes the relations of a given relation map into a JSON string.
94
- * 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,
95
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
96
- * The resulting object is then serialized into a JSON string.
97
- *
98
- * @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.
99
- * @returns A JSON string representing the serialized relations of the given relation map.
100
- */
101
- serializeRelations(relationMap: RelationsMap): string;
102
- /**
103
- * Serializes the relations of a specific model into a JSON string.
104
- * This method iterates through the relations indexed for the given model,
105
- * organizing them into a structured object where each key is an expressID of an entity,
106
- * and its value is another object mapping relation indices to arrays of related entity expressIDs.
107
- * The resulting object is then serialized into a JSON string.
108
- *
109
- * @param model The `FragmentsGroup` model whose relations are to be serialized.
110
- * @returns A JSON string representing the serialized relations of the specified model.
111
- * If the model has no indexed relations, `null` is returned.
112
- */
113
- serializeModelRelations(model: FragmentsGroup): string | null;
114
- /**
115
- * Serializes all relations of every model processed by the indexer into a JSON string.
116
- * This method iterates through each model's relations indexed in `relationMaps`, organizing them
117
- * into a structured JSON object. Each top-level key in this object corresponds to a model's UUID,
118
- * and its value is another object mapping entity expressIDs to their related entities, categorized
119
- * by relation types. The structure facilitates easy access to any entity's relations across all models.
120
- *
121
- * @returns A JSON string representing the serialized relations of all models processed by the indexer.
122
- * If no relations have been indexed, an empty object is returned as a JSON string.
123
- */
124
- serializeAllRelations(): string;
125
- /**
126
- * Converts a JSON string representing relations between entities into a structured map.
127
- * This method parses the JSON string to reconstruct the relations map that indexes
128
- * entity relations by their express IDs. The outer map keys are the express IDs of entities,
129
- * and the values are maps where each key is a relation type ID and its value is an array
130
- * of express IDs of entities related through that relation type.
131
- *
132
- * @param json The JSON string to be parsed into the relations map.
133
- * @returns A `Map` where the key is the express ID of an entity as a number, and the value
134
- * is another `Map`. This inner map's key is the relation type ID as a number, and its value
135
- * is an array of express IDs (as numbers) of entities related through that relation type.
136
- */
137
- getRelationsMapFromJSON(json: string): RelationsMap;
138
- /** {@link Disposable.dispose} */
139
- dispose(): void;
140
- /**
141
- * Retrieves the entities within a model that have a specific relation with a given entity.
142
- *
143
- * @param model - The BIM model to search for related entities.
144
- * @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
145
- * @param expressID - The expressID of the entity within the model.
146
- *
147
- * @returns A `Set` with the expressIDs of the entities that have the specified relation with the given entity.
148
- *
149
- * @throws An error if the model relations are not indexed or if the inverse attribute name is invalid.
150
- */
151
- getEntitiesWithRelation(model: FragmentsGroup, inv: InverseAttribute, expressID: number): Set<number>;
152
- /**
153
- * Adds relations between an entity and other entities in a BIM model.
154
- *
155
- * @param model - The BIM model to which the relations will be added.
156
- * @param expressID - The expressID of the entity within the model.
157
- * @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
158
- * @param relIDs - The expressIDs of the related entities within the model.
159
- * @deprecated Use addEntitiesRelation instead. This will be removed in future versions.
160
- *
161
- * @throws An error if the relation name is not a valid relation name.
162
- */
163
- addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
164
- /**
165
- * Converts the relations made into actual IFC data.
166
- *
167
- * @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
168
- * It only make sense to use it if the relations need to be write in the IFC file.
169
- *
170
- * @returns A promise that resolves when all the relation changes have been applied.
171
- */
172
- applyRelationChanges(): Promise<void>;
173
- private readonly _changeMap;
174
- /**
175
- * An event that is triggered when entities are related in a BIM model.
176
- * The event provides information about the type of relation, the inverse attribute,
177
- * the IDs of the entities related, and the IDs of the entities that are being related.
178
- */
179
- readonly onEntitiesRelated: Event<EntitiesRelatedEvent>;
180
- addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
181
- type: IfcRelation;
182
- inv: InverseAttribute;
183
- }, ...relatedIDs: number[]): void;
184
- /**
185
- * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
186
- *
187
- * @param model The BIM model whose children to get.
188
- * @param expressID The expressID of the item whose children to get.
189
- * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
190
- *
191
- * @returns A `Set` with the expressIDs of the found items.
192
- */
193
- getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
194
- }
195
- export * from "./src";