Skip to content

Commit

Permalink
feat(core): adds new relation in IfcRelationsIndexer
Browse files Browse the repository at this point in the history
  • Loading branch information
HoyosJuan committed Aug 2, 2024
1 parent 5633e42 commit 23c99ee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"three": "^0.160.1",
"web-ifc": "0.0.56"
}
}
}
2 changes: 2 additions & 0 deletions packages/core/src/ifc/IfcRelationsIndexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class IfcRelationsIndexer extends Component implements Disposable {
"AssignedToFlowElement",
"ConnectedTo",
"ConnectedFrom",
"ReferencedBy",
];

private _ifcRels: IfcRelations = [
Expand All @@ -88,6 +89,7 @@ export class IfcRelationsIndexer extends Component implements Disposable {
WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
WEBIFC.IFCRELFLOWCONTROLELEMENTS,
WEBIFC.IFCRELCONNECTSELEMENTS,
WEBIFC.IFCRELASSIGNSTOPRODUCT,
];

constructor(components: Components) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ export const relToAttributesMap = new Map<
[
WEBIFC.IFCRELAGGREGATES,
{
forRelating: "IsDecomposedBy",
forRelated: "Decomposes",
forRelating: "IsDecomposedBy",
},
],
[
WEBIFC.IFCRELASSOCIATESMATERIAL,
{
forRelating: "AssociatedTo",
forRelated: "HasAssociations",
forRelating: "AssociatedTo",
},
],
[
WEBIFC.IFCRELASSOCIATESCLASSIFICATION,
{
forRelating: "ClassificationForObjects",
forRelated: "HasAssociations",
forRelating: "ClassificationForObjects",
},
],
[
WEBIFC.IFCRELASSIGNSTOGROUP,
{
forRelating: "IsGroupedBy",
forRelated: "HasAssignments",
forRelating: "IsGroupedBy",
},
],
[
Expand Down Expand Up @@ -76,4 +76,11 @@ export const relToAttributesMap = new Map<
forRelating: "ConnectedTo",
},
],
[
WEBIFC.IFCRELASSIGNSTOPRODUCT,
{
forRelated: "HasAssignments",
forRelating: "ReferencedBy",
},
],
]);
2 changes: 2 additions & 0 deletions packages/core/src/ifc/IfcRelationsIndexer/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type InverseAttributes = [
"AssignedToFlowElement",
"ConnectedTo",
"ConnectedFrom",
"ReferencedBy",
];

export type InverseAttribute = InverseAttributes[number];
Expand All @@ -46,6 +47,7 @@ export type IfcRelations = [
typeof WEBIFC.IFCRELCONTAINEDINSPATIALSTRUCTURE,
typeof WEBIFC.IFCRELFLOWCONTROLELEMENTS,
typeof WEBIFC.IFCRELCONNECTSELEMENTS,
typeof WEBIFC.IFCRELASSIGNSTOPRODUCT,
];

export type IfcRelation = IfcRelations[number];

0 comments on commit 23c99ee

Please sign in to comment.