@ifc-lite/export 4.7.4 → 4.8.0

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 (88) hide show
  1. package/dist/entity-subgraph.d.ts +56 -0
  2. package/dist/entity-subgraph.d.ts.map +1 -0
  3. package/dist/entity-subgraph.js +138 -0
  4. package/dist/entity-subgraph.js.map +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +7 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/lod0-generator.d.ts.map +1 -1
  10. package/dist/lod0-generator.js +4 -1
  11. package/dist/lod0-generator.js.map +1 -1
  12. package/dist/merged-empty-containers.d.ts +12 -8
  13. package/dist/merged-empty-containers.d.ts.map +1 -1
  14. package/dist/merged-empty-containers.js +8 -4
  15. package/dist/merged-empty-containers.js.map +1 -1
  16. package/dist/merged-exporter.d.ts +1 -1
  17. package/dist/merged-exporter.d.ts.map +1 -1
  18. package/dist/merged-exporter.js +25 -28
  19. package/dist/merged-exporter.js.map +1 -1
  20. package/dist/merged-guid.d.ts +4 -0
  21. package/dist/merged-guid.d.ts.map +1 -1
  22. package/dist/merged-guid.js +14 -0
  23. package/dist/merged-guid.js.map +1 -1
  24. package/dist/merged-inverse-claims.d.ts +154 -0
  25. package/dist/merged-inverse-claims.d.ts.map +1 -0
  26. package/dist/merged-inverse-claims.js +306 -0
  27. package/dist/merged-inverse-claims.js.map +1 -0
  28. package/dist/merged-planner-guids.d.ts +32 -0
  29. package/dist/merged-planner-guids.d.ts.map +1 -0
  30. package/dist/merged-planner-guids.js +79 -0
  31. package/dist/merged-planner-guids.js.map +1 -0
  32. package/dist/merged-subcontext.d.ts.map +1 -1
  33. package/dist/merged-subcontext.js +1 -0
  34. package/dist/merged-subcontext.js.map +1 -1
  35. package/dist/parquet-exporter.d.ts.map +1 -1
  36. package/dist/parquet-exporter.js +2 -0
  37. package/dist/parquet-exporter.js.map +1 -1
  38. package/dist/property-value-serialization.d.ts.map +1 -1
  39. package/dist/property-value-serialization.js +2 -1
  40. package/dist/property-value-serialization.js.map +1 -1
  41. package/dist/reference-collector.js +3 -0
  42. package/dist/reference-collector.js.map +1 -1
  43. package/dist/related-entities.d.ts.map +1 -1
  44. package/dist/related-entities.js +6 -0
  45. package/dist/related-entities.js.map +1 -1
  46. package/dist/remesh-context-roots.d.ts +36 -0
  47. package/dist/remesh-context-roots.d.ts.map +1 -0
  48. package/dist/remesh-context-roots.js +126 -0
  49. package/dist/remesh-context-roots.js.map +1 -0
  50. package/dist/step-collection.js +1 -1
  51. package/dist/step-collection.js.map +1 -1
  52. package/dist/step-export-types.d.ts +2 -0
  53. package/dist/step-export-types.d.ts.map +1 -1
  54. package/dist/step-omission-predicates.d.ts +8 -0
  55. package/dist/step-omission-predicates.d.ts.map +1 -1
  56. package/dist/step-omission-predicates.js +11 -1
  57. package/dist/step-omission-predicates.js.map +1 -1
  58. package/dist/step-overlay-entities.d.ts.map +1 -1
  59. package/dist/step-overlay-entities.js +23 -1
  60. package/dist/step-overlay-entities.js.map +1 -1
  61. package/dist/step-pass-builder.d.ts.map +1 -1
  62. package/dist/step-pass-builder.js +1 -0
  63. package/dist/step-pass-builder.js.map +1 -1
  64. package/dist/step-property-set-collection.d.ts +2 -0
  65. package/dist/step-property-set-collection.d.ts.map +1 -1
  66. package/dist/step-property-set-collection.js +42 -21
  67. package/dist/step-property-set-collection.js.map +1 -1
  68. package/dist/step-property-set-generators.d.ts +1 -1
  69. package/dist/step-property-set-generators.d.ts.map +1 -1
  70. package/dist/step-property-set-generators.js +19 -2
  71. package/dist/step-property-set-generators.js.map +1 -1
  72. package/dist/step-property-set-index.js +5 -2
  73. package/dist/step-property-set-index.js.map +1 -1
  74. package/dist/step-property-sets.d.ts.map +1 -1
  75. package/dist/step-property-sets.js +5 -2
  76. package/dist/step-property-sets.js.map +1 -1
  77. package/dist/step-pset-copy-on-write.d.ts +75 -0
  78. package/dist/step-pset-copy-on-write.d.ts.map +1 -0
  79. package/dist/step-pset-copy-on-write.js +146 -0
  80. package/dist/step-pset-copy-on-write.js.map +1 -0
  81. package/dist/step-source-iteration.d.ts.map +1 -1
  82. package/dist/step-source-iteration.js +7 -0
  83. package/dist/step-source-iteration.js.map +1 -1
  84. package/package.json +8 -8
  85. package/dist/merged-decomposition-parents.d.ts +0 -99
  86. package/dist/merged-decomposition-parents.d.ts.map +0 -1
  87. package/dist/merged-decomposition-parents.js +0 -142
  88. package/dist/merged-decomposition-parents.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"step-source-iteration.d.ts","sourceRoot":"","sources":["../src/step-source-iteration.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAOrD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG7F;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC;;mCAE+B;IAC/B,QAAQ,CAAC,wBAAwB,EAAE,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EAAE,OAAO,EACtB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACnD,mBAAmB,CAAC;IACzB;8CAC0C;IAC1C,QAAQ,CAAC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tB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,KACnD,mBAAmB,CAAC;IACzB;8CAC0C;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD;2EACuE;IACvE,QAAQ,CAAC,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;IACtD;;;4DAGwD;IACxD,QAAQ,CAAC,2BAA2B,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACnF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,kBAAkB,EAAE,OAAO,EAC3B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAC5C,GAAG,EAAE,sBAAsB,GAC1B,IAAI,CA4NN"}
@@ -11,6 +11,7 @@ import { convertStepLine } from './schema-converter.js';
11
11
  import { nominateDeliveredInPlaceEdits } from './in-place-nomination.js';
12
12
  import { decodeRange } from './source-ref-bounds.js';
13
13
  import { retainSharedAtoms } from './step-shared-atom-retention.js';
14
+ import { detachRelatedObjects } from './step-pset-copy-on-write.js';
14
15
  import { IFC_ENTITY_NAMES } from '@ifc-lite/data';
15
16
  /**
16
17
  * Write every source-backed record this export keeps, into `pass.entities`.
@@ -108,6 +109,12 @@ export function writeSourceEntityLines(pass, options, mayNameOmittedRefs, isOmit
108
109
  const mutationWarnings = [];
109
110
  const mutated = applySourceLineMutationsReported(ctx.applySourceLineMutations, mutationWarnings, expressId, entityText, entityRef.type, pass.modifiedAttributes.get(expressId), pass.sourceSchema, pass.overlayActive);
110
111
  let nextEntityText = mutated.text;
112
+ // A shared IfcRelDefinesByProperties loses the elements that got their
113
+ // own copy of its set this export; the rest keep the original (#5794).
114
+ const narrowed = detachRelatedObjects(pass, expressId, nextEntityText);
115
+ if (narrowed === null)
116
+ continue;
117
+ nextEntityText = narrowed;
111
118
  // A hidden PRODUCT's own line is already out of the export via
112
119
  // `allowedEntityIds`, and a TOMBSTONED entity's via `effective` — this
113
120
  // is the relationship that NAMED either one. `IFCREL*` is an
@@ -1 +1 @@
1
- {"version":3,"file":"step-source-iteration.js","sourceRoot":"","sources":["../src/step-source-iteration.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAqD/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,eAAe,EAAyB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAsClD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAgB,EAChB,OAA0B,EAC1B,kBAA2B,EAC3B,mBAA4C,EAC5C,GAA2B;IAE3B,8EAA8E;IAC9E,uEAAuE;IACvE,8EAA8E;IAC9E,8EAA8E;IAC9E,gFAAgF;IAChF,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACrC,iBAAiB,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,GAA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,CAAC,OAAO;gBAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACtE,IAAI,OAAO,CAAC,UAAU;gBAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAC7E,gEAAgE;YAChE,wEAAwE;YACxE,8DAA8D;YAC9D,6BAA6B,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAE5F,qEAAqE;YACrE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACpB,MAAM,SAAS,GAAG,eAAe,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACtK,IAAI,SAAS,KAAK,IAAI;oBAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifc-lite/export",
3
- "version": "4.7.4",
3
+ "version": "4.8.0",
4
4
  "description": "Export formats for IFC-Lite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,18 +16,18 @@
16
16
  "parquet-wasm": "^0.8.0",
17
17
  "apache-arrow": "^21.2.0",
18
18
  "fflate": "^0.8.3",
19
- "@ifc-lite/geometry": "^7.5.2",
19
+ "@ifc-lite/geometry": "^7.6.0",
20
20
  "@ifc-lite/codegen": "^1.18.1",
21
- "@ifc-lite/data": "^6.0.0",
22
- "@ifc-lite/encoding": "^2.2.0",
23
- "@ifc-lite/parser": "^9.0.0",
24
- "@ifc-lite/mutations": "^2.8.0",
25
- "@ifc-lite/ifcx": "^4.2.1"
21
+ "@ifc-lite/data": "^6.1.0",
22
+ "@ifc-lite/encoding": "^2.3.0",
23
+ "@ifc-lite/parser": "^9.1.0",
24
+ "@ifc-lite/mutations": "^3.0.0",
25
+ "@ifc-lite/ifcx": "^4.3.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "jszip": "^3.10.2",
29
29
  "typescript": "^6.0.3",
30
- "vitest": "^5.0.1"
30
+ "vitest": "^5.0.2"
31
31
  },
32
32
  "license": "MPL-2.0",
33
33
  "author": "Louis True",
@@ -1,99 +0,0 @@
1
- /**
2
- * One-parent-per-object bookkeeping for the decomposition relationships of a
3
- * merge (#5471, #5726).
4
- *
5
- * Split out of {@link ../merged-exporter.ts} (kept under its module-size
6
- * budget) rather than duplicated: `findEntitiesByType`/`extractStepAttribute`
7
- * stay the single source of truth in `MergedExporter` and are passed in here,
8
- * so this file has no data-model logic of its own to drift from it.
9
- */
10
- import type { IfcDataStore } from '@ifc-lite/parser';
11
- import type { IfcSchemaVersion } from './schema-converter.js';
12
- /**
13
- * The final ids already given a WRITTEN parent in the merge output, per
14
- * single-valued decomposition inverse of the output schema. One instance per
15
- * merge, grown model by model in merge order.
16
- */
17
- export declare class DecompositionClaims {
18
- /** Relationship type (uppercase) → the inverse it fills; see {@link IFC4_INVERSES}. */
19
- readonly inverseOf: ReadonlyMap<string, string>;
20
- private readonly parented;
21
- /** `only` narrows the claimed relationship types (the #5725 drop planner's view). */
22
- constructor(outputSchema: IfcSchemaVersion, only?: (relType: string) => boolean);
23
- /** The final ids that already fill `inverse` in the output. */
24
- parentedVia(inverse: string): Set<number>;
25
- }
26
- /** What {@link claimDecompositionParents} needs to know about one model's plan. */
27
- export interface DecompositionClaimInput {
28
- dataStore: IfcDataStore;
29
- /** Local id → final id for every unified entity (spatial, infrastructure, GlobalId). */
30
- sharedRemap: ReadonlyMap<number, number>;
31
- /** This model's id offset: an unremapped local id's final id is `id + idOffset`. */
32
- idOffset: number;
33
- /** Local ids not written; a skipped rel claims nothing, and a rel skipped here is added. */
34
- skipEntityIds: Set<number>;
35
- /** Local rel id → member ids to drop from its written RelatedObjects list. */
36
- relParentStrip: Map<number, Set<number>>;
37
- /**
38
- * Whether a local id survives into the output as a reference: false for a
39
- * hidden product under `visibleOnly` or a dropped empty container, which
40
- * `renderEntity` narrows out of (or, as a RelatingObject, withholds) the rel.
41
- */
42
- isEmitted: (localId: number) => boolean;
43
- /** Whether the rel line itself is in the written set at all (visibility closure). */
44
- isIncluded: (localId: number) => boolean;
45
- /** Strip already-parented members (a later, unified model); false just records claims. */
46
- dedupe: boolean;
47
- }
48
- /**
49
- * Keep one decomposition parent per object and inverse across a merge (#5471,
50
- * #5726).
51
- *
52
- * `IfcObjectDefinition.Decomposes` (and, from IFC4, `.Nests`) is `SET [0:1]`,
53
- * and `IfcSpatialStructureElement.WR41` requires exactly one for a building or
54
- * storey. Once a later model's Building unifies with the primary's, the
55
- * primary's own rel already gives it a parent, so a later rel naming the same
56
- * (remapped) Building gives it a second one, whether that rel's RelatingObject
57
- * remaps to the same parent (a duplicate edge, e.g. `(Project, (Site))` twice)
58
- * or a different one (model B aggregates its Building under its Project, model
59
- * A under a Site). Which relationships share an inverse is the output schema's
60
- * call, held by {@link DecompositionClaims}.
61
- *
62
- * `claims` holds the final ids that already have a parent WRITTEN to the
63
- * output. Called once per model in merge order, after all of that model's
64
- * unification and container drops: every rel the model will write adds its
65
- * written members. A rel that will not be written (skipped, outside the
66
- * visibility closure, or with a hidden or dropped RelatingObject) claims
67
- * nothing, and neither does a member narrowed out of it, so a later model's rel
68
- * stays the parent of an object whose primary parent is not in the output.
69
- *
70
- * With `dedupe`, a written member already claimed for the rel's inverse is
71
- * redundant: a rel whose written members are ALL redundant is skipped, one with
72
- * SOME is kept for its new members and the redundant ids go to
73
- * `relParentStrip` for {@link applyRelParentStrip}. A unified member with no
74
- * parent yet is kept, since that rel is then its only parentage statement
75
- * (#3550).
76
- */
77
- export declare function claimDecompositionParents(input: DecompositionClaimInput, claims: DecompositionClaims, findEntitiesByType: (dataStore: IfcDataStore, typeUpper: string) => number[], extractStepAttribute: (expressId: number, dataStore: IfcDataStore, attrIndex: number) => string | null): void;
78
- /**
79
- * Render-time counterpart of {@link claimDecompositionParents}: drop the
80
- * RelatedObjects members of a partially redundant IFCRELAGGREGATES or
81
- * IFCRELNESTS that already have a parent of that kind in the output.
82
- * Reuses the same list/scalar-aware ref filter the
83
- * `visibleOnly`/deletion dangling-ref path uses. Must run in LOCAL id
84
- * space, before any id offset/remap — `localId` and the ids inside
85
- * `relParentStrip` are both local to the model being rendered.
86
- *
87
- * Returns `entityText` unchanged when `localId` has no strip entry, and
88
- * `null` when the filter would withhold the whole line — a strip set built
89
- * by {@link claimDecompositionParents} is a strict subset of the
90
- * RelatedObjects list, so for well-formed input the filter only narrows,
91
- * but a degenerate file (a stripped member id that also appears as a
92
- * single-valued ref, e.g. self-aggregation) can null the line. The caller
93
- * must withhold it, like every other user of the filter: every edge the
94
- * line declared is already declared by the primary model, and emitting the
95
- * unfiltered bytes instead would reintroduce the duplicate membership this
96
- * module exists to remove.
97
- */
98
- export declare function applyRelParentStrip(entityText: string, localId: number, relParentStrip: ReadonlyMap<number, ReadonlySet<number>>): string | null;
99
- //# sourceMappingURL=merged-decomposition-parents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merged-decomposition-parents.d.ts","sourceRoot":"","sources":["../src/merged-decomposition-parents.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAuB9D;;;;GAIG;AACH,qBAAa,mBAAmB;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,SAAS,EAAE,WAAW,CA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EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,GACvD,MAAM,GAAG,IAAI,CAIf"}
@@ -1,142 +0,0 @@
1
- /* This Source Code Form is subject to the terms of the Mozilla Public
2
- * License, v. 2.0. If a copy of the MPL was not distributed with this
3
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
- import { filterHiddenRefsFromRelationshipLine } from './reference-collector.js';
5
- /**
6
- * Each decomposition relationship → the `SET [0:1]` inverse on
7
- * `IfcObjectDefinition` its RelatedObjects fill, in the OUTPUT schema. Both
8
- * relationships carry RelatingObject at attr 4 and RelatedObjects at attr 5 in
9
- * every schema.
10
- *
11
- * IFC2X3: `Decomposes : SET [0:1] OF IfcRelDecomposes`, and IfcRelAggregates
12
- * and IfcRelNests are both IfcRelDecomposes, so one nesting and one
13
- * aggregation parent together are already two (#5726). IFC4 and later split
14
- * `Nests : SET [0:1] OF IfcRelNests` off `Decomposes : SET [0:1] OF
15
- * IfcRelAggregates`: one parent of each kind, but still only one each.
16
- */
17
- const IFC2X3_INVERSES = new Map([
18
- ['IFCRELAGGREGATES', 'Decomposes'],
19
- ['IFCRELNESTS', 'Decomposes'],
20
- ]);
21
- const IFC4_INVERSES = new Map([
22
- ['IFCRELAGGREGATES', 'Decomposes'],
23
- ['IFCRELNESTS', 'Nests'],
24
- ]);
25
- /**
26
- * The final ids already given a WRITTEN parent in the merge output, per
27
- * single-valued decomposition inverse of the output schema. One instance per
28
- * merge, grown model by model in merge order.
29
- */
30
- export class DecompositionClaims {
31
- /** Relationship type (uppercase) → the inverse it fills; see {@link IFC4_INVERSES}. */
32
- inverseOf;
33
- parented = new Map();
34
- /** `only` narrows the claimed relationship types (the #5725 drop planner's view). */
35
- constructor(outputSchema, only = () => true) {
36
- const inverses = outputSchema === 'IFC2X3' ? IFC2X3_INVERSES : IFC4_INVERSES;
37
- this.inverseOf = new Map([...inverses].filter(([relType]) => only(relType)));
38
- }
39
- /** The final ids that already fill `inverse` in the output. */
40
- parentedVia(inverse) {
41
- let ids = this.parented.get(inverse);
42
- if (ids === undefined)
43
- this.parented.set(inverse, (ids = new Set()));
44
- return ids;
45
- }
46
- }
47
- /**
48
- * Keep one decomposition parent per object and inverse across a merge (#5471,
49
- * #5726).
50
- *
51
- * `IfcObjectDefinition.Decomposes` (and, from IFC4, `.Nests`) is `SET [0:1]`,
52
- * and `IfcSpatialStructureElement.WR41` requires exactly one for a building or
53
- * storey. Once a later model's Building unifies with the primary's, the
54
- * primary's own rel already gives it a parent, so a later rel naming the same
55
- * (remapped) Building gives it a second one, whether that rel's RelatingObject
56
- * remaps to the same parent (a duplicate edge, e.g. `(Project, (Site))` twice)
57
- * or a different one (model B aggregates its Building under its Project, model
58
- * A under a Site). Which relationships share an inverse is the output schema's
59
- * call, held by {@link DecompositionClaims}.
60
- *
61
- * `claims` holds the final ids that already have a parent WRITTEN to the
62
- * output. Called once per model in merge order, after all of that model's
63
- * unification and container drops: every rel the model will write adds its
64
- * written members. A rel that will not be written (skipped, outside the
65
- * visibility closure, or with a hidden or dropped RelatingObject) claims
66
- * nothing, and neither does a member narrowed out of it, so a later model's rel
67
- * stays the parent of an object whose primary parent is not in the output.
68
- *
69
- * With `dedupe`, a written member already claimed for the rel's inverse is
70
- * redundant: a rel whose written members are ALL redundant is skipped, one with
71
- * SOME is kept for its new members and the redundant ids go to
72
- * `relParentStrip` for {@link applyRelParentStrip}. A unified member with no
73
- * parent yet is kept, since that rel is then its only parentage statement
74
- * (#3550).
75
- */
76
- export function claimDecompositionParents(input, claims, findEntitiesByType, extractStepAttribute) {
77
- const { dataStore, sharedRemap, idOffset, skipEntityIds, relParentStrip, isEmitted, isIncluded, dedupe } = input;
78
- const finalId = (ref) => sharedRemap.get(ref) ?? ref + idOffset;
79
- for (const [relType, inverse] of claims.inverseOf) {
80
- const parented = claims.parentedVia(inverse);
81
- for (const relId of findEntitiesByType(dataStore, relType)) {
82
- if (skipEntityIds.has(relId) || !isIncluded(relId))
83
- continue;
84
- // RelatingObject is attr 4 — a single #ref; a hidden or dropped one withholds the line.
85
- const relating = extractStepAttribute(relId, dataStore, 4)?.match(/^#(\d+)$/);
86
- if (relating && !isEmitted(parseInt(relating[1], 10)))
87
- continue;
88
- // RelatedObjects is attr 5 — list of #refs like (#2,#3); hidden members are narrowed out.
89
- const refs = listRefs(extractStepAttribute(relId, dataStore, 5)).filter(isEmitted);
90
- if (refs.length === 0)
91
- continue;
92
- const redundantRefs = dedupe ? refs.filter(ref => parented.has(finalId(ref))) : [];
93
- if (redundantRefs.length === refs.length) {
94
- // Every written member already has a parent in the output — fully redundant.
95
- skipEntityIds.add(relId);
96
- continue;
97
- }
98
- if (redundantRefs.length > 0)
99
- relParentStrip.set(relId, new Set(redundantRefs));
100
- for (const ref of refs)
101
- parented.add(finalId(ref));
102
- }
103
- }
104
- }
105
- /** The `#id`s in one STEP list attribute, in order; `[]` for a missing one. */
106
- function listRefs(attr) {
107
- if (!attr)
108
- return [];
109
- const refs = [];
110
- const refRegex = /#(\d+)/g;
111
- let match;
112
- while ((match = refRegex.exec(attr)) !== null)
113
- refs.push(parseInt(match[1], 10));
114
- return refs;
115
- }
116
- /**
117
- * Render-time counterpart of {@link claimDecompositionParents}: drop the
118
- * RelatedObjects members of a partially redundant IFCRELAGGREGATES or
119
- * IFCRELNESTS that already have a parent of that kind in the output.
120
- * Reuses the same list/scalar-aware ref filter the
121
- * `visibleOnly`/deletion dangling-ref path uses. Must run in LOCAL id
122
- * space, before any id offset/remap — `localId` and the ids inside
123
- * `relParentStrip` are both local to the model being rendered.
124
- *
125
- * Returns `entityText` unchanged when `localId` has no strip entry, and
126
- * `null` when the filter would withhold the whole line — a strip set built
127
- * by {@link claimDecompositionParents} is a strict subset of the
128
- * RelatedObjects list, so for well-formed input the filter only narrows,
129
- * but a degenerate file (a stripped member id that also appears as a
130
- * single-valued ref, e.g. self-aggregation) can null the line. The caller
131
- * must withhold it, like every other user of the filter: every edge the
132
- * line declared is already declared by the primary model, and emitting the
133
- * unfiltered bytes instead would reintroduce the duplicate membership this
134
- * module exists to remove.
135
- */
136
- export function applyRelParentStrip(entityText, localId, relParentStrip) {
137
- const toStrip = relParentStrip.get(localId);
138
- if (toStrip === undefined)
139
- return entityText;
140
- return filterHiddenRefsFromRelationshipLine(entityText, id => toStrip.has(id));
141
- }
142
- //# sourceMappingURL=merged-decomposition-parents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merged-decomposition-parents.js","sourceRoot":"","sources":["../src/merged-decomposition-parents.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAGhF;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAgC,IAAI,GAAG,CAAC;IAC3D,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAClC,CAAC,aAAa,EAAE,YAAY,CAAC;CAC9B,CAAC,CAAC;AACH,MAAM,aAAa,GAAgC,IAAI,GAAG,CAAC;IACzD,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAClC,CAAC,aAAa,EAAE,OAAO,CAAC;CACzB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAC9B,uFAAuF;IAC9E,SAAS,CAA8B;IAC/B,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE3D,qFAAqF;IACrF,YAAY,YAA8B,EAAE,OAAqC,GAAG,EAAE,CAAC,IAAI;QACzF,MAAM,QAAQ,GAAG,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7E,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,CAAC;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