Skip to content

Commit

Permalink
fix(core): correct indexer bug skipping nested spatial elements
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Jul 23, 2024
1 parent 086855d commit 13c92dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components",
"description": "Collection of core functionalities to author BIM apps.",
"version": "2.1.12",
"version": "2.1.13",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/core/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class Components implements Disposable {
/**
* The version of the @thatopen/components library.
*/
static readonly release = "2.1.12";
static readonly release = "2.1.13";

/** {@link Disposable.onDisposed} */
readonly onDisposed = new Event<void>();
Expand Down
13 changes: 10 additions & 3 deletions packages/core/src/ifc/IfcRelationsIndexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class IfcRelationsIndexer extends Component implements Disposable {
const currentMap =
relationsMap.get(relatingID) ?? new Map<number, number[]>();
const index = this.getAttributeIndex(relating);
if (index) {
if (index !== null) {
currentMap.set(index, relatedIDs);
relationsMap.set(relatingID, currentMap);
}
Expand Down Expand Up @@ -186,11 +186,18 @@ export class IfcRelationsIndexer extends Component implements Disposable {

for (const relType of this._ifcRels) {
const relsAttrs = await model.getAllPropertiesOfType(relType);
if (!relsAttrs) continue;
if (!relsAttrs) {
continue;
}

const relInverseAttributes = this._relToAttributesMap.get(relType);
if (!relInverseAttributes) continue;
if (!relInverseAttributes) {
continue;
}

const { forRelated: related, forRelating: relating } =
relInverseAttributes;

for (const expressID in relsAttrs) {
const relAttrs = relsAttrs[expressID];
this.indexRelations(relationsMap, relAttrs, related, relating);
Expand Down

0 comments on commit 13c92dd

Please sign in to comment.