@thatopen/components 2.2.0 → 2.2.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.
package/dist/index.mjs CHANGED
@@ -7515,6 +7515,19 @@ const nc = /* @__PURE__ */ new Map([
7515
7515
  }
7516
7516
  return r;
7517
7517
  }
7518
+ // private readonly _changeMap: {
7519
+ // [modelID: string]: {
7520
+ // [attr: InverseAttribute]: {
7521
+ // [expressID: number]: { added: number[]; removed: number[] };
7522
+ // };
7523
+ // };
7524
+ // };
7525
+ // removeEntitiesRelation(
7526
+ // model: FragmentsGroup,
7527
+ // expressID: number,
7528
+ // relationName: InverseAttribute,
7529
+ // ...relIDs: number[]
7530
+ // ) {}
7518
7531
  /**
7519
7532
  * Adds relations between an entity and other entities in a BIM model.
7520
7533
  *
@@ -7543,6 +7556,33 @@ const nc = /* @__PURE__ */ new Map([
7543
7556
  a == null || a.set(o, n);
7544
7557
  }
7545
7558
  }
7559
+ // private async addEntitiesRelation(
7560
+ // model: FragmentsGroup,
7561
+ // expressID: number,
7562
+ // rel: { name: InverseAttribute; type: IfcRelName },
7563
+ // ...relIDs: number[]
7564
+ // ) {
7565
+ // const { name, type } = rel;
7566
+ // const ifcRel = createIfcRel(
7567
+ // type,
7568
+ // expressID,
7569
+ // relIDs,
7570
+ // model.ifcMetadata.schema,
7571
+ // );
7572
+ // if (!ifcRel) return;
7573
+ // const propsManager = this.components.get(IfcPropertiesManager);
7574
+ // await propsManager.setData(model, ifcRel);
7575
+ // // ------
7576
+ // const existingRelations = this.getEntityRelations(model, expressID, name);
7577
+ // if (!existingRelations) {
7578
+ // const attributeIndex = this.getAttributeIndex(name);
7579
+ // if (!attributeIndex) return;
7580
+ // const entityRelations = this.relationMaps[model.uuid].get(expressID);
7581
+ // entityRelations?.set(attributeIndex, relIDs);
7582
+ // } else {
7583
+ // existingRelations.push(...relIDs);
7584
+ // }
7585
+ // }
7546
7586
  /**
7547
7587
  * 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.
7548
7588
  *
@@ -14745,7 +14785,7 @@ const Te = class Te extends Ot {
14745
14785
  async setData(t, ...e) {
14746
14786
  for (const i of e) {
14747
14787
  const { expressID: n } = i;
14748
- (!n || n === -1) && (i.expressID = this.increaseMaxID(t)), await t.setProperties(n, i), this.registerChange(t, n);
14788
+ (!n || n === -1) && (i.expressID = this.getNewExpressID(t)), await t.setProperties(i.expressID, i), this.registerChange(t, n);
14749
14789
  }
14750
14790
  }
14751
14791
  /**
@@ -14768,7 +14808,7 @@ const Te = class Te extends Ot {
14768
14808
  l,
14769
14809
  []
14770
14810
  );
14771
- h.expressID = this.increaseMaxID(t);
14811
+ h.expressID = this.getNewExpressID(t);
14772
14812
  const u = this.newGUID(t), d = new K[n].IfcRelDefinesByProperties(
14773
14813
  u,
14774
14814
  r,
@@ -14777,7 +14817,7 @@ const Te = class Te extends Ot {
14777
14817
  [],
14778
14818
  new K.Handle(h.expressID)
14779
14819
  );
14780
- return d.expressID = this.increaseMaxID(t), await this.setData(t, h, d), { pset: h, rel: d };
14820
+ return d.expressID = this.getNewExpressID(t), await this.setData(t, h, d), { pset: h, rel: d };
14781
14821
  }
14782
14822
  /**
14783
14823
  * Removes a Property Set (Pset) from the given model.
@@ -15005,7 +15045,7 @@ const Te = class Te extends Ot {
15005
15045
  }
15006
15046
  }), r[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] = l, l;
15007
15047
  }
15008
- increaseMaxID(t) {
15048
+ getNewExpressID(t) {
15009
15049
  return t.ifcMetadata.maxExpressID++, t.ifcMetadata.maxExpressID;
15010
15050
  }
15011
15051
  newGUID(t) {
@@ -15033,7 +15073,7 @@ const Te = class Te extends Ot {
15033
15073
  a,
15034
15074
  null
15035
15075
  );
15036
- return l.expressID = this.increaseMaxID(t), await this.setData(t, l), l;
15076
+ return l.expressID = this.getNewExpressID(t), await this.setData(t, l), l;
15037
15077
  }
15038
15078
  };
15039
15079
  /**