@thatopen/components 2.2.5 → 2.2.6
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/Components/index.d.ts +1 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +19 -1
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +7 -0
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +3 -0
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +18 -0
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +33 -3
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +2 -0
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +1 -1
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +4 -2
- package/dist/index.cjs +28 -28
- package/dist/index.mjs +8082 -7902
- package/dist/namespace.d.ts +1571 -1495
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export declare class Components implements Disposable {
|
|
|
6
6
|
/**
|
|
7
7
|
* The version of the @thatopen/components library.
|
|
8
8
|
*/
|
|
9
|
-
static readonly release = "2.2.
|
|
9
|
+
static readonly release = "2.2.6";
|
|
10
10
|
/** {@link Disposable.onDisposed} */
|
|
11
11
|
readonly onDisposed: Event<void>;
|
|
12
12
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as WEBIFC from "web-ifc";
|
|
2
2
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
3
3
|
import { Component, Disposable, Event, Components } from "../../core";
|
|
4
|
+
import { IfcRelation } from "../IfcRelationsIndexer";
|
|
4
5
|
/**
|
|
5
6
|
* Types for boolean properties in IFC schema.
|
|
6
7
|
*/
|
|
@@ -207,7 +208,10 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
207
208
|
* @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
|
|
208
209
|
*/
|
|
209
210
|
removePsetProp(model: FragmentsGroup, psetID: number, propID: number): Promise<void>;
|
|
210
|
-
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated Use indexer.addEntitiesRelation instead. This will be removed in future releases.
|
|
213
|
+
*/
|
|
214
|
+
addElementToPset(model: FragmentsGroup, psetID: number, ...expressIDs: number[]): void;
|
|
211
215
|
/**
|
|
212
216
|
* Adds elements to a Property Set (Pset) in the given model.
|
|
213
217
|
*
|
|
@@ -222,6 +226,19 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
222
226
|
* @throws Will throw an error if no relation is found between the Pset and the model.
|
|
223
227
|
*/
|
|
224
228
|
addPropToPset(model: FragmentsGroup, psetID: number, ...propID: number[]): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a new instance of a relationship between entities in the IFC model.
|
|
231
|
+
*
|
|
232
|
+
* @param model - The FragmentsGroup model in which to create the relationship.
|
|
233
|
+
* @param type - The type of the relationship to create.
|
|
234
|
+
* @param relatingID - The express ID of the entity that is related to the other entities.
|
|
235
|
+
* @param relatedIDs - The express IDs of the entities that are related to the relating entity.
|
|
236
|
+
*
|
|
237
|
+
* @returns A promise that resolves with the newly created relationship.
|
|
238
|
+
*
|
|
239
|
+
* @throws Will throw an error if the relationship type is unsupported.
|
|
240
|
+
*/
|
|
241
|
+
createIfcRel(model: FragmentsGroup, type: IfcRelation, relatingID: number, relatedIDs: number[]): Promise<any>;
|
|
225
242
|
/**
|
|
226
243
|
* Saves the changes made to the model to a new IFC file.
|
|
227
244
|
*
|
|
@@ -265,3 +282,4 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
265
282
|
private registerChange;
|
|
266
283
|
private newSingleProperty;
|
|
267
284
|
}
|
|
285
|
+
export * from "./src";
|
|
@@ -0,0 +1,18 @@
|
|
|
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,8 +1,7 @@
|
|
|
1
1
|
import * as WEBIFC from "web-ifc";
|
|
2
2
|
import { FragmentsGroup } from "@thatopen/fragments";
|
|
3
3
|
import { Disposable, Event, Component, Components } from "../../core";
|
|
4
|
-
import { RelationsMap, ModelsRelationMap, InverseAttribute } from "./src
|
|
5
|
-
export type { InverseAttribute, RelationsMap } from "./src/types";
|
|
4
|
+
import { RelationsMap, ModelsRelationMap, InverseAttribute, IfcRelation } from "./src";
|
|
6
5
|
/**
|
|
7
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).
|
|
8
7
|
*/
|
|
@@ -140,7 +139,7 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
140
139
|
/** {@link Disposable.dispose} */
|
|
141
140
|
dispose(): void;
|
|
142
141
|
/**
|
|
143
|
-
* Retrieves the entities within a
|
|
142
|
+
* Retrieves the entities within a model that have a specific relation with a given entity.
|
|
144
143
|
*
|
|
145
144
|
* @param model - The BIM model to search for related entities.
|
|
146
145
|
* @param inv - The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements").
|
|
@@ -158,10 +157,40 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
158
157
|
* @param expressID - The expressID of the entity within the model.
|
|
159
158
|
* @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
|
|
160
159
|
* @param relIDs - The expressIDs of the related entities within the model.
|
|
160
|
+
* @deprecated Use addEntitiesRelation instead. This will be removed in future versions.
|
|
161
161
|
*
|
|
162
162
|
* @throws An error if the relation name is not a valid relation name.
|
|
163
163
|
*/
|
|
164
164
|
addEntityRelations(model: FragmentsGroup, expressID: number, relationName: InverseAttribute, ...relIDs: number[]): void;
|
|
165
|
+
/**
|
|
166
|
+
* Converts the relations made into actual IFC data.
|
|
167
|
+
*
|
|
168
|
+
* @remarks This function iterates through the changes made to the relations and applies them to the corresponding BIM model.
|
|
169
|
+
* It only make sense to use if the relations need to be write in the IFC file.
|
|
170
|
+
*
|
|
171
|
+
* @returns A promise that resolves when all the relation changes have been applied.
|
|
172
|
+
*/
|
|
173
|
+
applyRelationChanges(): Promise<void>;
|
|
174
|
+
private readonly _changeMap;
|
|
175
|
+
/**
|
|
176
|
+
* An event that is triggered when entities are related in a BIM model.
|
|
177
|
+
* The event provides information about the type of relation, the inverse attribute,
|
|
178
|
+
* the IDs of the entities related, and the IDs of the entities that are being related.
|
|
179
|
+
*/
|
|
180
|
+
readonly onEntitiesRelated: Event<{
|
|
181
|
+
/** The type of the IFC relation. */
|
|
182
|
+
relType: IfcRelation;
|
|
183
|
+
/** The inverse attribute of the relation. */
|
|
184
|
+
invAttribute: InverseAttribute;
|
|
185
|
+
/** The IDs of the entities that are relating. */
|
|
186
|
+
relatingIDs: number[];
|
|
187
|
+
/** The IDs of the entities that are being related. */
|
|
188
|
+
relatedIDs: number[];
|
|
189
|
+
}>;
|
|
190
|
+
addEntitiesRelation(model: FragmentsGroup, relatingID: number, rel: {
|
|
191
|
+
type: IfcRelation;
|
|
192
|
+
inv: InverseAttribute;
|
|
193
|
+
}, ...relatedIDs: number[]): void;
|
|
165
194
|
/**
|
|
166
195
|
* 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.
|
|
167
196
|
*
|
|
@@ -173,3 +202,4 @@ export declare class IfcRelationsIndexer extends Component implements Disposable
|
|
|
173
202
|
*/
|
|
174
203
|
getEntityChildren(model: FragmentsGroup, expressID: number, found?: Set<number>): Set<number>;
|
|
175
204
|
}
|
|
205
|
+
export * from "./src";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InverseAttribute } from "./types";
|
|
2
|
-
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585, {
|
|
2
|
+
export declare const relToAttributesMap: Map<160246688 | 2655215786 | 919958153 | 1307041759 | 4186316022 | 781010003 | 307848117 | 3242617779 | 279856033 | 1204542856 | 2857406711 | 2565941209 | 2495723537 | 3268803585 | 982818633, {
|
|
3
3
|
forRelating: InverseAttribute;
|
|
4
4
|
forRelated: InverseAttribute;
|
|
5
5
|
}>;
|
|
@@ -30,7 +30,8 @@ export type InverseAttributes = [
|
|
|
30
30
|
"HasContext",
|
|
31
31
|
"Controls",
|
|
32
32
|
"IsNestedBy",
|
|
33
|
-
"Nests"
|
|
33
|
+
"Nests",
|
|
34
|
+
"DocumentRefForObjects"
|
|
34
35
|
];
|
|
35
36
|
export type InverseAttribute = InverseAttributes[number];
|
|
36
37
|
/**
|
|
@@ -50,6 +51,7 @@ export type IfcRelations = [
|
|
|
50
51
|
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
|
|
51
52
|
typeof WEBIFC.IFCRELDECLARES,
|
|
52
53
|
typeof WEBIFC.IFCRELASSIGNSTOCONTROL,
|
|
53
|
-
typeof WEBIFC.IFCRELNESTS
|
|
54
|
+
typeof WEBIFC.IFCRELNESTS,
|
|
55
|
+
typeof WEBIFC.IFCRELASSOCIATESDOCUMENT
|
|
54
56
|
];
|
|
55
57
|
export type IfcRelation = IfcRelations[number];
|