@ifc-lite/export 4.14.0 → 6.0.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.
- package/dist/anonymize-placement.d.ts.map +1 -1
- package/dist/anonymize-placement.js +2 -2
- package/dist/anonymize-placement.js.map +1 -1
- package/dist/attribute-slot-types.d.ts.map +1 -1
- package/dist/attribute-slot-types.js +3 -1
- package/dist/attribute-slot-types.js.map +1 -1
- package/dist/effective-index-created-rows.d.ts +3 -0
- package/dist/effective-index-created-rows.d.ts.map +1 -1
- package/dist/effective-index-created-rows.js +16 -5
- package/dist/effective-index-created-rows.js.map +1 -1
- package/dist/effective-index.d.ts.map +1 -1
- package/dist/effective-index.js +2 -1
- package/dist/effective-index.js.map +1 -1
- package/dist/entity-iteration.d.ts +1 -1
- package/dist/entity-iteration.d.ts.map +1 -1
- package/dist/entity-iteration.js.map +1 -1
- package/dist/generated/ifc2x3-typed-properties.d.ts +11 -0
- package/dist/generated/ifc2x3-typed-properties.d.ts.map +1 -0
- package/dist/generated/ifc2x3-typed-properties.js +49 -0
- package/dist/generated/ifc2x3-typed-properties.js.map +1 -0
- package/dist/georef-closure.d.ts +12 -0
- package/dist/georef-closure.d.ts.map +1 -1
- package/dist/georef-closure.js +3 -1
- package/dist/georef-closure.js.map +1 -1
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +3 -10
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/merged-bake.d.ts +32 -0
- package/dist/merged-bake.d.ts.map +1 -0
- package/dist/merged-bake.js +120 -0
- package/dist/merged-bake.js.map +1 -0
- package/dist/merged-context.d.ts +49 -6
- package/dist/merged-context.d.ts.map +1 -1
- package/dist/merged-context.js +165 -53
- package/dist/merged-context.js.map +1 -1
- package/dist/merged-exporter.d.ts +7 -14
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +112 -178
- package/dist/merged-exporter.js.map +1 -1
- package/dist/merged-georef-normalize.d.ts +54 -0
- package/dist/merged-georef-normalize.d.ts.map +1 -0
- package/dist/merged-georef-normalize.js +260 -0
- package/dist/merged-georef-normalize.js.map +1 -0
- package/dist/merged-guid.d.ts +5 -7
- package/dist/merged-guid.d.ts.map +1 -1
- package/dist/merged-guid.js +37 -42
- package/dist/merged-guid.js.map +1 -1
- package/dist/merged-header.d.ts +6 -0
- package/dist/merged-header.d.ts.map +1 -1
- package/dist/merged-header.js +6 -0
- package/dist/merged-header.js.map +1 -1
- package/dist/merged-inverse-claims.d.ts.map +1 -1
- package/dist/merged-inverse-claims.js +3 -2
- package/dist/merged-inverse-claims.js.map +1 -1
- package/dist/merged-planner-guids.d.ts +1 -0
- package/dist/merged-planner-guids.d.ts.map +1 -1
- package/dist/merged-planner-guids.js +5 -6
- package/dist/merged-planner-guids.js.map +1 -1
- package/dist/merged-project-contexts.d.ts +12 -0
- package/dist/merged-project-contexts.d.ts.map +1 -0
- package/dist/merged-project-contexts.js +56 -0
- package/dist/merged-project-contexts.js.map +1 -0
- package/dist/merged-remap.d.ts +3 -1
- package/dist/merged-remap.d.ts.map +1 -1
- package/dist/merged-remap.js +15 -1
- package/dist/merged-remap.js.map +1 -1
- package/dist/merged-subcontext.d.ts +22 -0
- package/dist/merged-subcontext.d.ts.map +1 -1
- package/dist/merged-subcontext.js +14 -18
- package/dist/merged-subcontext.js.map +1 -1
- package/dist/schema-calendar-date-values.d.ts +15 -0
- package/dist/schema-calendar-date-values.d.ts.map +1 -0
- package/dist/schema-calendar-date-values.js +107 -0
- package/dist/schema-calendar-date-values.js.map +1 -0
- package/dist/schema-calendar-dates.d.ts +11 -0
- package/dist/schema-calendar-dates.d.ts.map +1 -0
- package/dist/schema-calendar-dates.js +127 -0
- package/dist/schema-calendar-dates.js.map +1 -0
- package/dist/schema-conversion-loss-description.d.ts +3 -0
- package/dist/schema-conversion-loss-description.d.ts.map +1 -0
- package/dist/schema-conversion-loss-description.js +23 -0
- package/dist/schema-conversion-loss-description.js.map +1 -0
- package/dist/schema-conversion-loss-report.d.ts +22 -19
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +223 -61
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-attr-maps.d.ts +63 -0
- package/dist/schema-converter-attr-maps.d.ts.map +1 -0
- package/dist/schema-converter-attr-maps.js +186 -0
- package/dist/schema-converter-attr-maps.js.map +1 -0
- package/dist/schema-converter-attr-remap.d.ts +2 -2
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +9 -5
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter-document-links.d.ts +23 -0
- package/dist/schema-converter-document-links.d.ts.map +1 -0
- package/dist/schema-converter-document-links.js +146 -0
- package/dist/schema-converter-document-links.js.map +1 -0
- package/dist/schema-converter-durations.d.ts +9 -0
- package/dist/schema-converter-durations.d.ts.map +1 -0
- package/dist/schema-converter-durations.js +60 -0
- package/dist/schema-converter-durations.js.map +1 -0
- package/dist/schema-converter-enums.d.ts +18 -2
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +39 -6
- package/dist/schema-converter-enums.js.map +1 -1
- package/dist/schema-converter-ifc2x3-slots.d.ts +1 -1
- package/dist/schema-converter-ifc2x3-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc2x3-slots.js +6 -5
- package/dist/schema-converter-ifc2x3-slots.js.map +1 -1
- package/dist/schema-converter-ifc4-slots.d.ts +4 -3
- package/dist/schema-converter-ifc4-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc4-slots.js +4 -3
- package/dist/schema-converter-ifc4-slots.js.map +1 -1
- package/dist/schema-converter-ifc4x3-upgrade.d.ts +5 -0
- package/dist/schema-converter-ifc4x3-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-ifc4x3-upgrade.js +41 -0
- package/dist/schema-converter-ifc4x3-upgrade.js.map +1 -0
- package/dist/schema-converter-material-referent.d.ts +55 -0
- package/dist/schema-converter-material-referent.d.ts.map +1 -0
- package/dist/schema-converter-material-referent.js +184 -0
- package/dist/schema-converter-material-referent.js.map +1 -0
- package/dist/schema-converter-owner-history.d.ts +1 -1
- package/dist/schema-converter-owner-history.d.ts.map +1 -1
- package/dist/schema-converter-owner-history.js +4 -3
- package/dist/schema-converter-owner-history.js.map +1 -1
- package/dist/schema-converter-product-proxy.d.ts +0 -23
- package/dist/schema-converter-product-proxy.d.ts.map +1 -1
- package/dist/schema-converter-product-proxy.js +2 -1
- package/dist/schema-converter-product-proxy.js.map +1 -1
- package/dist/schema-converter-renames.d.ts +17 -0
- package/dist/schema-converter-renames.d.ts.map +1 -1
- package/dist/schema-converter-renames.js +34 -2
- package/dist/schema-converter-renames.js.map +1 -1
- package/dist/schema-converter-retyped.d.ts +17 -0
- package/dist/schema-converter-retyped.d.ts.map +1 -0
- package/dist/schema-converter-retyped.js +68 -0
- package/dist/schema-converter-retyped.js.map +1 -0
- package/dist/schema-converter-step-finish.d.ts +4 -0
- package/dist/schema-converter-step-finish.d.ts.map +1 -0
- package/dist/schema-converter-step-finish.js +27 -0
- package/dist/schema-converter-step-finish.js.map +1 -0
- package/dist/schema-converter-structural-axes.d.ts +48 -4
- package/dist/schema-converter-structural-axes.d.ts.map +1 -1
- package/dist/schema-converter-structural-axes.js +350 -31
- package/dist/schema-converter-structural-axes.js.map +1 -1
- package/dist/schema-converter-structural-carriers.d.ts +78 -0
- package/dist/schema-converter-structural-carriers.d.ts.map +1 -0
- package/dist/schema-converter-structural-carriers.js +336 -0
- package/dist/schema-converter-structural-carriers.js.map +1 -0
- package/dist/schema-converter-structural-diagnostics.d.ts +56 -9
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -1
- package/dist/schema-converter-structural-diagnostics.js +170 -17
- package/dist/schema-converter-structural-diagnostics.js.map +1 -1
- package/dist/schema-converter-structural-links.d.ts +2 -2
- package/dist/schema-converter-structural-links.d.ts.map +1 -1
- package/dist/schema-converter-structural-links.js +3 -28
- package/dist/schema-converter-structural-links.js.map +1 -1
- package/dist/schema-converter-structural-source.d.ts +83 -0
- package/dist/schema-converter-structural-source.d.ts.map +1 -0
- package/dist/schema-converter-structural-source.js +207 -0
- package/dist/schema-converter-structural-source.js.map +1 -0
- package/dist/schema-converter-structural-thickness.d.ts +33 -0
- package/dist/schema-converter-structural-thickness.d.ts.map +1 -0
- package/dist/schema-converter-structural-thickness.js +155 -0
- package/dist/schema-converter-structural-thickness.js.map +1 -0
- package/dist/schema-converter-structural-varying.d.ts +21 -9
- package/dist/schema-converter-structural-varying.d.ts.map +1 -1
- package/dist/schema-converter-structural-varying.js +83 -54
- package/dist/schema-converter-structural-varying.js.map +1 -1
- package/dist/schema-converter-structural.d.ts +2 -2
- package/dist/schema-converter-structural.d.ts.map +1 -1
- package/dist/schema-converter-structural.js +9 -6
- package/dist/schema-converter-structural.js.map +1 -1
- package/dist/schema-converter-typed-properties.d.ts +30 -0
- package/dist/schema-converter-typed-properties.d.ts.map +1 -0
- package/dist/schema-converter-typed-properties.js +173 -0
- package/dist/schema-converter-typed-properties.js.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts +14 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.js +228 -0
- package/dist/schema-converter-unrooted-upgrade.js.map +1 -0
- package/dist/schema-converter-userdefined-label.d.ts +8 -0
- package/dist/schema-converter-userdefined-label.d.ts.map +1 -0
- package/dist/schema-converter-userdefined-label.js +61 -0
- package/dist/schema-converter-userdefined-label.js.map +1 -0
- package/dist/schema-converter-userdefined.d.ts +15 -0
- package/dist/schema-converter-userdefined.d.ts.map +1 -0
- package/dist/schema-converter-userdefined.js +59 -0
- package/dist/schema-converter-userdefined.js.map +1 -0
- package/dist/schema-converter-value-forms.d.ts +20 -0
- package/dist/schema-converter-value-forms.d.ts.map +1 -0
- package/dist/schema-converter-value-forms.js +225 -0
- package/dist/schema-converter-value-forms.js.map +1 -0
- package/dist/schema-converter.d.ts +10 -15
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +87 -83
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-enum-policy.d.ts +5 -1
- package/dist/schema-enum-policy.d.ts.map +1 -1
- package/dist/schema-enum-policy.js +21 -1
- package/dist/schema-enum-policy.js.map +1 -1
- package/dist/schema-ifc2x3-placements.d.ts.map +1 -1
- package/dist/schema-ifc2x3-placements.js +20 -31
- package/dist/schema-ifc2x3-placements.js.map +1 -1
- package/dist/schema-ifc2x3-records.d.ts.map +1 -1
- package/dist/schema-ifc2x3-records.js +3 -2
- package/dist/schema-ifc2x3-records.js.map +1 -1
- package/dist/schema-ifc2x3-style-assignments.d.ts +4 -0
- package/dist/schema-ifc2x3-style-assignments.d.ts.map +1 -0
- package/dist/schema-ifc2x3-style-assignments.js +33 -0
- package/dist/schema-ifc2x3-style-assignments.js.map +1 -0
- package/dist/schema-structural-varying-effective.d.ts +2 -0
- package/dist/schema-structural-varying-effective.d.ts.map +1 -0
- package/dist/schema-structural-varying-effective.js +95 -0
- package/dist/schema-structural-varying-effective.js.map +1 -0
- package/dist/schema-untranslatable.d.ts +22 -13
- package/dist/schema-untranslatable.d.ts.map +1 -1
- package/dist/schema-untranslatable.js +84 -6
- package/dist/schema-untranslatable.js.map +1 -1
- package/dist/schema-value-form-policy.d.ts +129 -0
- package/dist/schema-value-form-policy.d.ts.map +1 -0
- package/dist/schema-value-form-policy.js +255 -0
- package/dist/schema-value-form-policy.js.map +1 -0
- package/dist/step-argument-parser.d.ts +3 -3
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +6 -6
- package/dist/step-argument-parser.js.map +1 -1
- package/dist/step-collection.d.ts.map +1 -1
- package/dist/step-collection.js +2 -0
- package/dist/step-collection.js.map +1 -1
- package/dist/step-comment-skip.d.ts +8 -0
- package/dist/step-comment-skip.d.ts.map +1 -1
- package/dist/step-comment-skip.js +30 -0
- package/dist/step-comment-skip.js.map +1 -1
- package/dist/step-coordinate-options.d.ts +15 -0
- package/dist/step-coordinate-options.d.ts.map +1 -1
- package/dist/step-coordinate-options.js +13 -1
- package/dist/step-coordinate-options.js.map +1 -1
- package/dist/step-export-types.d.ts +5 -7
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts +0 -6
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +19 -12
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-georeferencing.d.ts +2 -0
- package/dist/step-georeferencing.d.ts.map +1 -1
- package/dist/step-georeferencing.js +126 -63
- package/dist/step-georeferencing.js.map +1 -1
- package/dist/step-header.d.ts.map +1 -1
- package/dist/step-header.js +1 -0
- package/dist/step-header.js.map +1 -1
- package/dist/step-internal-pset-ids.js +1 -1
- package/dist/step-internal-pset-ids.js.map +1 -1
- package/dist/step-map-unit-normalization.d.ts.map +1 -1
- package/dist/step-map-unit-normalization.js +5 -4
- package/dist/step-map-unit-normalization.js.map +1 -1
- package/dist/step-map-unit.d.ts +8 -1
- package/dist/step-map-unit.d.ts.map +1 -1
- package/dist/step-map-unit.js +13 -5
- package/dist/step-map-unit.js.map +1 -1
- package/dist/step-omission-predicates.d.ts.map +1 -1
- package/dist/step-omission-predicates.js +1 -0
- package/dist/step-omission-predicates.js.map +1 -1
- package/dist/step-overlay-entities.d.ts +0 -35
- package/dist/step-overlay-entities.d.ts.map +1 -1
- package/dist/step-overlay-entities.js +38 -2
- package/dist/step-overlay-entities.js.map +1 -1
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +59 -7
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-record-frame.d.ts +5 -3
- package/dist/step-record-frame.d.ts.map +1 -1
- package/dist/step-record-frame.js +12 -8
- package/dist/step-record-frame.js.map +1 -1
- package/dist/step-ref-scan.d.ts +12 -0
- package/dist/step-ref-scan.d.ts.map +1 -1
- package/dist/step-ref-scan.js +24 -3
- package/dist/step-ref-scan.js.map +1 -1
- package/dist/step-serialization.d.ts +12 -0
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +15 -0
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-slot-grammar.d.ts +3 -2
- package/dist/step-slot-grammar.d.ts.map +1 -1
- package/dist/step-slot-grammar.js +5 -5
- package/dist/step-slot-grammar.js.map +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +6 -9
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/unit-normalize.d.ts +2 -2
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +23 -13
- package/dist/unit-normalize.js.map +1 -1
- package/dist/viewer-georef-scale.d.ts +14 -0
- package/dist/viewer-georef-scale.d.ts.map +1 -0
- package/dist/viewer-georef-scale.js +20 -0
- package/dist/viewer-georef-scale.js.map +1 -0
- package/package.json +41 -8
|
@@ -17,10 +17,16 @@
|
|
|
17
17
|
* record whose arity is not the target's is left alone, the same guard the
|
|
18
18
|
* required-slot passes use (position `i` need not be attribute `i`).
|
|
19
19
|
*/
|
|
20
|
+
import { TypedPropertyUpgrade } from './schema-converter-typed-properties.js';
|
|
20
21
|
import { StructuralDiagnostics } from './schema-converter-structural-diagnostics.js';
|
|
22
|
+
import { DocumentLinks } from './schema-converter-document-links.js';
|
|
23
|
+
import { ValueForms } from './schema-converter-value-forms.js';
|
|
24
|
+
import { MaterialReferents } from './schema-converter-material-referent.js';
|
|
21
25
|
import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
22
26
|
import { escapeStepString } from './step-serialization.js';
|
|
23
|
-
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
27
|
+
import { readStepSlots, splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
28
|
+
import { breaksUserDefinedRule, userDefinedRule } from './schema-converter-userdefined.js';
|
|
29
|
+
import { isUnset } from './schema-converter-userdefined-label.js';
|
|
24
30
|
import { resolveMissingEnumMember } from './schema-enum-policy.js';
|
|
25
31
|
const TARGETS = new Map();
|
|
26
32
|
function targetEntities(schema) {
|
|
@@ -51,11 +57,34 @@ const LOSS_TEXT = {
|
|
|
51
57
|
};
|
|
52
58
|
/** Enum reconciliation for one export: rewrites, and counts what it lost. */
|
|
53
59
|
export class EnumReconciliation {
|
|
60
|
+
typedProperties;
|
|
54
61
|
/** Reuses this per-export collector so both STEP writers forward structural losses. */
|
|
55
62
|
structural = new StructuralDiagnostics();
|
|
63
|
+
/** The IfcDocumentInformation <-> IfcDocumentReference link (#10846). */
|
|
64
|
+
documents = new DocumentLinks();
|
|
65
|
+
/** Values a target slot's type cannot hold (#10847). */
|
|
66
|
+
forms;
|
|
67
|
+
/** The IfcMaterial a downgraded IfcMaterialProperties names (#10763). */
|
|
68
|
+
materials;
|
|
69
|
+
constructor(deferConversions = false, timeUnitSources) {
|
|
70
|
+
this.forms = new ValueForms(deferConversions, timeUnitSources);
|
|
71
|
+
this.typedProperties = new TypedPropertyUpgrade(deferConversions);
|
|
72
|
+
this.materials = new MaterialReferents();
|
|
73
|
+
}
|
|
56
74
|
losses = new Map();
|
|
57
|
-
/**
|
|
58
|
-
|
|
75
|
+
/** Records written `.USERDEFINED.` with the label their rule needs unset, per type (#10780). */
|
|
76
|
+
unlabelled = new Map();
|
|
77
|
+
/** Reconcile `line`, already converted to `toSchema`, then report a broken USERDEFINED rule (#10780). */
|
|
78
|
+
apply(line, toSchema, maxReferenceId) {
|
|
79
|
+
const out = this.reconcile(line, toSchema, maxReferenceId);
|
|
80
|
+
// Only a record that says USERDEFINED can break the rule; the rest stop here.
|
|
81
|
+
const record = /\.USERDEFINED\./i.test(out) ? readStepSlots(out, maxReferenceId) : null;
|
|
82
|
+
const rule = record ? userDefinedRule(toSchema, record.type) : undefined;
|
|
83
|
+
if (record && rule && breaksUserDefinedRule(record.slots, rule))
|
|
84
|
+
this.unlabelled.set(record.type, (this.unlabelled.get(record.type) ?? 0) + 1);
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
reconcile(line, toSchema, maxReferenceId) {
|
|
59
88
|
const open = line.indexOf('(');
|
|
60
89
|
const close = line.lastIndexOf(')');
|
|
61
90
|
const eq = line.indexOf('=');
|
|
@@ -65,7 +94,7 @@ export class EnumReconciliation {
|
|
|
65
94
|
const entity = targetEntities(toSchema).get(type);
|
|
66
95
|
if (!entity)
|
|
67
96
|
return line;
|
|
68
|
-
const values = splitTopLevelStepArguments(line.slice(open + 1, close));
|
|
97
|
+
const values = splitTopLevelStepArguments(line.slice(open + 1, close), maxReferenceId);
|
|
69
98
|
if (values === null || values.length !== entity.attributes.length)
|
|
70
99
|
return line;
|
|
71
100
|
let changed = false;
|
|
@@ -78,7 +107,7 @@ export class EnumReconciliation {
|
|
|
78
107
|
switch (resolution.kind) {
|
|
79
108
|
case 'userdefined':
|
|
80
109
|
values[index] = '.USERDEFINED.';
|
|
81
|
-
if (values[resolution.labelIndex]
|
|
110
|
+
if (isUnset(values[resolution.labelIndex]))
|
|
82
111
|
values[resolution.labelIndex] = `'${escapeStepString(member)}'`;
|
|
83
112
|
else
|
|
84
113
|
this.record('userdefined-label-occupied', where);
|
|
@@ -109,7 +138,11 @@ export class EnumReconciliation {
|
|
|
109
138
|
const total = [...where.values()].reduce((a, b) => a + b, 0);
|
|
110
139
|
out.push(`${total} enum value(s) the target schema does not define were ${LOSS_TEXT[loss]}: ${[...where.keys()].join(', ')} (#5365).`);
|
|
111
140
|
}
|
|
112
|
-
|
|
141
|
+
if (this.unlabelled.size > 0) {
|
|
142
|
+
const total = [...this.unlabelled.values()].reduce((a, b) => a + b, 0);
|
|
143
|
+
out.push(`${total} record(s) say .USERDEFINED. without the label their rule needs; none is invented: ${[...this.unlabelled.keys()].join(', ')} (#10780).`);
|
|
144
|
+
}
|
|
145
|
+
return [...out, ...this.documents.warnings(), ...this.forms.warnings(), ...this.materials.warnings(), ...this.structural.warnings(), ...this.typedProperties.warnings()];
|
|
113
146
|
}
|
|
114
147
|
record(loss, where) {
|
|
115
148
|
const bucket = this.losses.get(loss) ?? new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-enums.js","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAkC,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-converter-enums.js","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAkC,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EA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;QAC7J,CAAC;QACD,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3K,CAAC;IAEO,MAAM,CAAC,IAAU,EAAE,KAAa;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAkB,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -36,7 +36,7 @@ export declare class Ifc2x3SlotFill {
|
|
|
36
36
|
* history of its own reuses one an earlier model wrote. */
|
|
37
37
|
prefer(ref: string | null): void;
|
|
38
38
|
/** Apply both fills to an already-converted IFC2X3 line `#id=TYPE(attrs);`. */
|
|
39
|
-
apply(line: string): string;
|
|
39
|
+
apply(line: string, maxReferenceId?: number): string;
|
|
40
40
|
/** One warning per non-zero counter, in the channel the exporters already
|
|
41
41
|
* carry. Same texts as the Rust twin's. */
|
|
42
42
|
warnings(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-ifc2x3-slots.d.ts","sourceRoot":"","sources":["../src/schema-converter-ifc2x3-slots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-converter-ifc2x3-slots.d.ts","sourceRoot":"","sources":["../src/schema-converter-ifc2x3-slots.ts"],"names":[],"mappings":"AASA;8EAC8E;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAMlF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0B;IAEvD;;gDAE4C;IAC5C,OAAO,CAAC,gBAAgB,CAAK;IAE7B;;gEAE4D;IAC5D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIhC,+EAA+E;IAC/E,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM;IAIpD;gDAC4C;IAC5C,QAAQ,IAAI,MAAM,EAAE;IAYpB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,YAAY;CAqBrB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { withoutComments } from './step-comment-skip.js';
|
|
4
5
|
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
5
6
|
import { OwnerHistoryFill } from './schema-converter-owner-history.js';
|
|
6
7
|
import { IFC2X3_REQUIRED_SLOTS } from './generated/ifc2x3-required-slots.js';
|
|
@@ -46,8 +47,8 @@ export class Ifc2x3SlotFill {
|
|
|
46
47
|
this.ownerHistory.prefer(ref);
|
|
47
48
|
}
|
|
48
49
|
/** Apply both fills to an already-converted IFC2X3 line `#id=TYPE(attrs);`. */
|
|
49
|
-
apply(line) {
|
|
50
|
-
return this.fillRequired(this.ownerHistory.apply(line));
|
|
50
|
+
apply(line, maxReferenceId) {
|
|
51
|
+
return this.fillRequired(this.ownerHistory.apply(line, maxReferenceId), maxReferenceId);
|
|
51
52
|
}
|
|
52
53
|
/** One warning per non-zero counter, in the channel the exporters already
|
|
53
54
|
* carry. Same texts as the Rust twin's. */
|
|
@@ -75,7 +76,7 @@ export class Ifc2x3SlotFill {
|
|
|
75
76
|
* Such a record is left alone AND not counted: nothing about its required
|
|
76
77
|
* slots was established.
|
|
77
78
|
*/
|
|
78
|
-
fillRequired(line) {
|
|
79
|
+
fillRequired(line, maxReferenceId) {
|
|
79
80
|
const open = line.indexOf('(');
|
|
80
81
|
const close = line.lastIndexOf(')');
|
|
81
82
|
const eq = line.indexOf('=');
|
|
@@ -84,12 +85,12 @@ export class Ifc2x3SlotFill {
|
|
|
84
85
|
const row = BY_TYPE.get(line.slice(eq + 1, open).trim().toUpperCase());
|
|
85
86
|
if (row === undefined)
|
|
86
87
|
return line;
|
|
87
|
-
const values = splitTopLevelStepArguments(line.slice(open + 1, close));
|
|
88
|
+
const values = splitTopLevelStepArguments(line.slice(open + 1, close), maxReferenceId);
|
|
88
89
|
if (values === null || values.length !== row.arity)
|
|
89
90
|
return line;
|
|
90
91
|
let changed = false;
|
|
91
92
|
for (const [index, , fill] of row.slots) {
|
|
92
|
-
if (values[index]
|
|
93
|
+
if (withoutComments(values[index]) !== '$')
|
|
93
94
|
continue;
|
|
94
95
|
if (fill === null) {
|
|
95
96
|
this.requiredUnfilled++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-ifc2x3-slots.js","sourceRoot":"","sources":["../src/schema-converter-ifc2x3-slots.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAA2B,MAAM,sCAAsC,CAAC;AAEtG;8EAC8E;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,qEAAqE;AACrE,MAAM,OAAO,GACX,IAAI,GAAG,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,IAA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AAG,CAAC,EAAE,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC;QACvF,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QAChE,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,KAAK,MAAM,CAAC,KAAK,EAAE,AAAD,EAAG,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YACxC,IAAI,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG;gBAAE,SAAS;YACrD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,SAAS;YACX,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;YACrB,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;QACD,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
* problem (#5202 finding 1). The count surfaces as one warning, so the caller
|
|
16
16
|
* learns the file is not valid IFC4 instead of receiving an invented value.
|
|
17
17
|
*
|
|
18
|
-
* `convertStepLine`
|
|
19
|
-
* IFC2X3 → IFC4
|
|
20
|
-
* `
|
|
18
|
+
* `convertStepLine` consults this for `fromSchema` `'IFC4X3'`/`'IFC5'`, and for
|
|
19
|
+
* the IFC2X3 → IFC4 records a structural rewrite or an attribute map wrote
|
|
20
|
+
* (`upgradeCountsIfc4Slots`, #10763). The rest of IFC2X3 → IFC4 is a separately
|
|
21
|
+
* audited upgrade path, pinned byte-for-byte by `schema-converter-door-window-type.test.ts`.
|
|
21
22
|
*/
|
|
22
23
|
export declare class Ifc4SlotCheck {
|
|
23
24
|
/** Required slots left `$`. Counted per SLOT: one record can leave several. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-ifc4-slots.d.ts","sourceRoot":"","sources":["../src/schema-converter-ifc4-slots.ts"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"schema-converter-ifc4-slots.d.ts","sourceRoot":"","sources":["../src/schema-converter-ifc4-slots.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,aAAa;IACxB,+EAA+E;IAC/E,OAAO,CAAC,gBAAgB,CAAK;IAE7B,iFAAiF;IACjF,QAAQ,IAAI,MAAM,EAAE;IASpB;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAc5B"}
|
|
@@ -24,9 +24,10 @@ const NULL_TOKEN = /^(?:\s|\/\*[\s\S]*?\*\/)*\$(?:\s|\/\*[\s\S]*?\*\/)*$/;
|
|
|
24
24
|
* problem (#5202 finding 1). The count surfaces as one warning, so the caller
|
|
25
25
|
* learns the file is not valid IFC4 instead of receiving an invented value.
|
|
26
26
|
*
|
|
27
|
-
* `convertStepLine`
|
|
28
|
-
* IFC2X3 → IFC4
|
|
29
|
-
* `
|
|
27
|
+
* `convertStepLine` consults this for `fromSchema` `'IFC4X3'`/`'IFC5'`, and for
|
|
28
|
+
* the IFC2X3 → IFC4 records a structural rewrite or an attribute map wrote
|
|
29
|
+
* (`upgradeCountsIfc4Slots`, #10763). The rest of IFC2X3 → IFC4 is a separately
|
|
30
|
+
* audited upgrade path, pinned byte-for-byte by `schema-converter-door-window-type.test.ts`.
|
|
30
31
|
*/
|
|
31
32
|
export class Ifc4SlotCheck {
|
|
32
33
|
/** Required slots left `$`. Counted per SLOT: one record can leave several. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-ifc4-slots.js","sourceRoot":"","sources":["../src/schema-converter-ifc4-slots.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,oCAAoC,CAAC;AAEhG,qEAAqE;AACrE,MAAM,OAAO,GACX,IAAI,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvF,mEAAmE;AACnE,MAAM,UAAU,GAAG,sDAAsD,CAAC;AAE1E
|
|
1
|
+
{"version":3,"file":"schema-converter-ifc4-slots.js","sourceRoot":"","sources":["../src/schema-converter-ifc4-slots.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,oCAAoC,CAAC;AAEhG,qEAAqE;AACrE,MAAM,OAAO,GACX,IAAI,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvF,mEAAmE;AACnE,MAAM,UAAU,GAAG,sDAAsD,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,aAAa;IACxB,+EAA+E;IACvE,gBAAgB,GAAG,CAAC,CAAC;IAE7B,iFAAiF;IACjF,QAAQ;QACN,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAC3C,OAAO;YACL,GAAG,IAAI,CAAC,gBAAgB,yEAAyE;gBACjG,6FAA6F;gBAC7F,qCAAqC;SACtC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAY;QAChB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QACvD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACvE,IAAI,GAAG,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACnC,MAAM,MAAM,GAAG,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACvE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QAChE,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function upgradeIfc4x3Type(source: string): string | undefined;
|
|
2
|
+
export declare function needsIfc4x3SlotMap(source: string): boolean;
|
|
3
|
+
export declare function remapIfc4x3Slots(type: string, source: readonly string[], target: readonly string[], args: readonly string[]): string;
|
|
4
|
+
export declare function droppedIfc4x3SlotNames(type: string, source: readonly string[], target: readonly string[]): string[];
|
|
5
|
+
//# sourceMappingURL=schema-converter-ifc4x3-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-ifc4x3-upgrade.d.ts","sourceRoot":"","sources":["../src/schema-converter-ifc4x3-upgrade.ts"],"names":[],"mappings":"AAuBA,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D;AAMD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAKpI;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAGnH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
// IFC4X3 dropped the old case entities. Their supertypes have the same slots.
|
|
3
|
+
// Replacements with a changed layout use a name-based map.
|
|
4
|
+
const renamed = new Map([
|
|
5
|
+
['IFCBEAMSTANDARDCASE', 'IFCBEAM'],
|
|
6
|
+
['IFCBUILDINGELEMENT', 'IFCBUILTELEMENT'],
|
|
7
|
+
['IFCBUILDINGELEMENTTYPE', 'IFCBUILTELEMENTTYPE'],
|
|
8
|
+
['IFCCOLUMNSTANDARDCASE', 'IFCCOLUMN'],
|
|
9
|
+
['IFCDOORSTANDARDCASE', 'IFCDOOR'],
|
|
10
|
+
['IFCMEMBERSTANDARDCASE', 'IFCMEMBER'],
|
|
11
|
+
['IFCOPENINGSTANDARDCASE', 'IFCOPENINGELEMENT'],
|
|
12
|
+
['IFCPLATESTANDARDCASE', 'IFCPLATE'],
|
|
13
|
+
['IFCSLABELEMENTEDCASE', 'IFCSLAB'],
|
|
14
|
+
['IFCSLABSTANDARDCASE', 'IFCSLAB'],
|
|
15
|
+
['IFCWALLELEMENTEDCASE', 'IFCWALL'],
|
|
16
|
+
['IFCWINDOWSTANDARDCASE', 'IFCWINDOW'],
|
|
17
|
+
['IFCDOORSTYLE', 'IFCDOORTYPE'],
|
|
18
|
+
['IFCELECTRICDISTRIBUTIONPOINT', 'IFCDISTRIBUTIONBOARD'],
|
|
19
|
+
['IFCWINDOWSTYLE', 'IFCWINDOWTYPE'],
|
|
20
|
+
['IFCPROXY', 'IFCBUILDINGELEMENTPROXY'],
|
|
21
|
+
]);
|
|
22
|
+
export function upgradeIfc4x3Type(source) {
|
|
23
|
+
return renamed.get(source);
|
|
24
|
+
}
|
|
25
|
+
export function needsIfc4x3SlotMap(source) {
|
|
26
|
+
return source === 'IFCDOORSTYLE' || source === 'IFCWINDOWSTYLE' || source === 'IFCPROXY';
|
|
27
|
+
}
|
|
28
|
+
function sourceName(type, target) {
|
|
29
|
+
return type === 'IFCWINDOWSTYLE' && target === 'PartitioningType' ? 'OperationType' : target;
|
|
30
|
+
}
|
|
31
|
+
export function remapIfc4x3Slots(type, source, target, args) {
|
|
32
|
+
// The source operation and proxy type differ from the target PredefinedType.
|
|
33
|
+
return target.map((name) => name === 'PredefinedType'
|
|
34
|
+
? '.NOTDEFINED.'
|
|
35
|
+
: args[source.indexOf(sourceName(type, name))] ?? '$').join(',');
|
|
36
|
+
}
|
|
37
|
+
export function droppedIfc4x3SlotNames(type, source, target) {
|
|
38
|
+
const used = new Set(target.map((name) => sourceName(type, name)));
|
|
39
|
+
return source.filter((name) => !used.has(name));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=schema-converter-ifc4x3-upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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C/F,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAyB,EAAE,MAAyB,EAAE,IAAuB;IAC1H,6EAA6E;IAC7E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,gBAAgB;QACnD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,MAAyB,EAAE,MAAyB;IACvG,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type SourceStore } from './schema-converter-structural-source.js';
|
|
2
|
+
/** Whether a `from` -> `to` export downgrades IfcMaterialProperties: the one rule the writers and the report share. */
|
|
3
|
+
export declare const downgradesMaterial: (from: string, to: string) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* The records the export writes, by id in the line's id space: the effective
|
|
6
|
+
* model in an export (edits, overlay-created records, retypes and deletions
|
|
7
|
+
* applied), a merged model's under its offset, the source in a report.
|
|
8
|
+
*/
|
|
9
|
+
export interface MaterialSource {
|
|
10
|
+
/** The UPPERCASE type of a record the export writes; undefined for one it does not. */
|
|
11
|
+
typeOf(id: number): string | undefined;
|
|
12
|
+
/** Its slots as written; undefined for a record the export does not write or could not read. */
|
|
13
|
+
slots(id: number): readonly string[] | undefined;
|
|
14
|
+
/** A material record the export has but does not write (deleted, filtered out): a set member it leaves out of the list. As Rust's `gone`. */
|
|
15
|
+
gone?(id: number): boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class MaterialReferents {
|
|
18
|
+
private source;
|
|
19
|
+
/** Record id -> why it was not written: the type its `Material` names, or `unreadable` / `no Material` / `an unread record`. */
|
|
20
|
+
private readonly dropped;
|
|
21
|
+
/** The export's record lookup. Without one nothing resolves, so every downgraded record is left out and reported: never carried unchecked. */
|
|
22
|
+
constructor(source?: MaterialSource);
|
|
23
|
+
/** The merged exporter's next model: its records, in the merge's id space. */
|
|
24
|
+
rearm(source: MaterialSource): void;
|
|
25
|
+
/** The IfcMaterial `id` resolves to, in a `from` record, or null. A set member the export does not write is left out of the set, as the writers leave it out of the list. */
|
|
26
|
+
resolve(id: number, from: string): number | null;
|
|
27
|
+
/**
|
|
28
|
+
* `line`, a source-schema record before conversion, its IfcMaterialProperties
|
|
29
|
+
* `Material` naming the one IfcMaterial it resolves to; null when none, so the
|
|
30
|
+
* record is not written. Resolved before conversion, so a reference the
|
|
31
|
+
* converter withholds (an IFC4-only set) is replaced first.
|
|
32
|
+
*/
|
|
33
|
+
apply(line: string, from: string, to: string): string | null;
|
|
34
|
+
/** A referent by its material type when it could be read; one that could not is named so, not blamed for its materials. */
|
|
35
|
+
private referentName;
|
|
36
|
+
/** Whether `apply` left record `id` out. */
|
|
37
|
+
leftOut(id: number): boolean;
|
|
38
|
+
warnings(): string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The IfcMaterialProperties records of `store` an IFC4/IFC4X3 -> IFC2X3
|
|
42
|
+
* export leaves out, with their attribute names, for the loss report.
|
|
43
|
+
*/
|
|
44
|
+
export declare function materialPropertiesNotWritten(store: Pick<SourceStore, 'entityIndex'> & Partial<Pick<SourceStore, 'source' | 'deferredEntityIndex'>>, from: string, to: string): {
|
|
45
|
+
ids: number[];
|
|
46
|
+
attributes: readonly string[];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Arms `materials` with a merged model's records (#10763) and returns the
|
|
50
|
+
* model's `written` predicate, for the merge loop: its `written` local ids
|
|
51
|
+
* under `offset`, their text remapped as the merge remaps it. Material records
|
|
52
|
+
* are never shared infrastructure, so a merged id is the local id plus the offset.
|
|
53
|
+
*/
|
|
54
|
+
export declare function armMergedModel(materials: MaterialReferents, store: SourceStore, written: (id: number) => boolean, offset: number, sharedRemap: ReadonlyMap<number, number>): (id: number) => boolean;
|
|
55
|
+
//# sourceMappingURL=schema-converter-material-referent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-material-referent.d.ts","sourceRoot":"","sources":["../src/schema-converter-material-referent.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAW9G,uHAAuH;AACvH,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,OAAoE,CAAC;AAEnI;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC,gGAAgG;IAChG,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IACjD,6IAA6I;IAC7I,IAAI,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED,qBAAa,iBAAiB;IAKhB,OAAO,CAAC,MAAM;IAJ1B,gIAAgI;IAChI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,8IAA8I;gBAC1H,MAAM,GAAE,cAAwB;IAEpD,8EAA8E;IAC9E,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAInC,6KAA6K;IAC7K,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAiChD;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAyB5D,2HAA2H;IAC3H,OAAO,CAAC,YAAY;IAKpB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAE5B,QAAQ,IAAI,MAAM,EAAE;CAKrB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,qBAAqB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAe/N;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAgBpM"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/**
|
|
3
|
+
* The `Material` a downgraded IfcMaterialProperties may name (#10763).
|
|
4
|
+
*
|
|
5
|
+
* IFC4 types `IfcMaterialProperties.Material` as any IfcMaterialDefinition
|
|
6
|
+
* (a material, a layer, a layer/profile/constituent set or member); IFC2X3
|
|
7
|
+
* `IfcExtendedMaterialProperties.Material` takes an IfcMaterial only. So the
|
|
8
|
+
* downgrade cannot carry the reference by value:
|
|
9
|
+
* - an IfcMaterial is kept;
|
|
10
|
+
* - a definition whose `Material`, or whose members' `Material`, is exactly
|
|
11
|
+
* one IfcMaterial is pointed at that material;
|
|
12
|
+
* - anything else, the record is not written (`apply` returns null) and the
|
|
13
|
+
* export and the loss report name it.
|
|
14
|
+
* Attributes are found by name in the source schema, so subtypes such as
|
|
15
|
+
* IfcMaterialLayerWithOffsets resolve too. Twin of Rust
|
|
16
|
+
* `schema_material_referent.rs`. Both resolve the record as the writer hands
|
|
17
|
+
* it over (edited, created), before conversion, against the records the
|
|
18
|
+
* export writes: the single, subset and merged paths each build their
|
|
19
|
+
* `MaterialSource` from what they write.
|
|
20
|
+
*/
|
|
21
|
+
import { attrNameTable } from './schema-converter.js';
|
|
22
|
+
import { listItems } from './schema-converter-structural-axes.js';
|
|
23
|
+
import { SourceRecords, slotRef, slotUnset } from './schema-converter-structural-source.js';
|
|
24
|
+
import { readStepSlots, splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
25
|
+
import { frameArgs, stepRecordFrame, stepRecordHead, withFrameArgs } from './step-record-frame.js';
|
|
26
|
+
import { remapEntityText } from './merged-remap.js';
|
|
27
|
+
/** The member lists of the IFC4 material sets. */
|
|
28
|
+
const MEMBERS = ['MaterialLayers', 'MaterialProfiles', 'MaterialConstituents'];
|
|
29
|
+
const PROPERTIES = 'IFCMATERIALPROPERTIES';
|
|
30
|
+
/** A lookup that knows no record. */
|
|
31
|
+
const NOTHING = { typeOf: () => undefined, slots: () => undefined };
|
|
32
|
+
/** Whether a `from` -> `to` export downgrades IfcMaterialProperties: the one rule the writers and the report share. */
|
|
33
|
+
export const downgradesMaterial = (from, to) => to === 'IFC2X3' && (from === 'IFC4' || from === 'IFC4X3');
|
|
34
|
+
export class MaterialReferents {
|
|
35
|
+
source;
|
|
36
|
+
/** Record id -> why it was not written: the type its `Material` names, or `unreadable` / `no Material` / `an unread record`. */
|
|
37
|
+
dropped = new Map();
|
|
38
|
+
/** The export's record lookup. Without one nothing resolves, so every downgraded record is left out and reported: never carried unchecked. */
|
|
39
|
+
constructor(source = NOTHING) {
|
|
40
|
+
this.source = source;
|
|
41
|
+
}
|
|
42
|
+
/** The merged exporter's next model: its records, in the merge's id space. */
|
|
43
|
+
rearm(source) {
|
|
44
|
+
this.source = source;
|
|
45
|
+
}
|
|
46
|
+
/** The IfcMaterial `id` resolves to, in a `from` record, or null. A set member the export does not write is left out of the set, as the writers leave it out of the list. */
|
|
47
|
+
resolve(id, from) {
|
|
48
|
+
const source = this.source, type = source.typeOf(id);
|
|
49
|
+
if (!type)
|
|
50
|
+
return null;
|
|
51
|
+
if (type === 'IFCMATERIAL')
|
|
52
|
+
return source.slots(id) ? id : null;
|
|
53
|
+
const table = attrNameTable(from), names = table?.get(type), slots = source.slots(id);
|
|
54
|
+
if (!names || !slots)
|
|
55
|
+
return null;
|
|
56
|
+
const material = (slot) => {
|
|
57
|
+
const ref = slotRef(slot);
|
|
58
|
+
return ref !== null && source.typeOf(ref) === 'IFCMATERIAL' && source.slots(ref) ? ref : null;
|
|
59
|
+
};
|
|
60
|
+
const own = names.indexOf('Material');
|
|
61
|
+
if (own >= 0)
|
|
62
|
+
return material(slots[own]);
|
|
63
|
+
const at = names.findIndex((n) => MEMBERS.includes(n));
|
|
64
|
+
if (at < 0)
|
|
65
|
+
return null;
|
|
66
|
+
const found = new Set();
|
|
67
|
+
for (const member of listItems(slots[at]) ?? []) {
|
|
68
|
+
const ref = slotRef(member);
|
|
69
|
+
if (ref === null)
|
|
70
|
+
return null;
|
|
71
|
+
const memberType = source.typeOf(ref);
|
|
72
|
+
// Skipped only when the export leaves it out of the list; a missing record names no material, as in Rust.
|
|
73
|
+
if (memberType === undefined) {
|
|
74
|
+
if (source.gone?.(ref))
|
|
75
|
+
continue;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const memberSlots = source.slots(ref);
|
|
79
|
+
const m = table?.get(memberType)?.indexOf('Material') ?? -1;
|
|
80
|
+
if (m < 0 || !memberSlots)
|
|
81
|
+
return null;
|
|
82
|
+
// A member without a material (an air gap) names none.
|
|
83
|
+
if (slotUnset(memberSlots[m]))
|
|
84
|
+
continue;
|
|
85
|
+
const named = material(memberSlots[m]);
|
|
86
|
+
if (named === null)
|
|
87
|
+
return null;
|
|
88
|
+
found.add(named);
|
|
89
|
+
}
|
|
90
|
+
return found.size === 1 ? [...found][0] : null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* `line`, a source-schema record before conversion, its IfcMaterialProperties
|
|
94
|
+
* `Material` naming the one IfcMaterial it resolves to; null when none, so the
|
|
95
|
+
* record is not written. Resolved before conversion, so a reference the
|
|
96
|
+
* converter withholds (an IFC4-only set) is replaced first.
|
|
97
|
+
*/
|
|
98
|
+
apply(line, from, to) {
|
|
99
|
+
const head = downgradesMaterial(from, to) ? stepRecordHead(line) : null;
|
|
100
|
+
// A length check first, so most records never build an upper-case copy.
|
|
101
|
+
if (!head || head.typeEnd - head.typeStart !== PROPERTIES.length || line.slice(head.typeStart, head.typeEnd).toUpperCase() !== PROPERTIES)
|
|
102
|
+
return line;
|
|
103
|
+
const at = attrNameTable(from)?.get(PROPERTIES)?.indexOf('Material') ?? -1;
|
|
104
|
+
if (at < 0)
|
|
105
|
+
return line;
|
|
106
|
+
// Framed as `convertRecord` frames it, which also accepts a record without its ';'.
|
|
107
|
+
// A record that cannot be read is not checked, so it is left out too.
|
|
108
|
+
const frame = stepRecordFrame(line, { allowMissingSemicolon: true });
|
|
109
|
+
const slots = frame ? splitTopLevelStepArguments(frameArgs(line, frame)) : null;
|
|
110
|
+
const named = slotRef(slots?.[at]);
|
|
111
|
+
const material = named === null ? null : this.resolve(named, from);
|
|
112
|
+
if (frame && slots && material !== null) { // `frame && slots` only narrows: unread, no material
|
|
113
|
+
if (material === named)
|
|
114
|
+
return line;
|
|
115
|
+
const out = [...slots];
|
|
116
|
+
out[at] = `#${material}`;
|
|
117
|
+
return withFrameArgs(line, frame, out.join(','));
|
|
118
|
+
}
|
|
119
|
+
// Named as Rust names it: the record unreadable, without a Material, or by its referent.
|
|
120
|
+
const why = !slots ? 'unreadable' : named === null ? 'no Material' : this.referentName(named);
|
|
121
|
+
const id = slotRef(line.slice(0, head.eq)); // past a leading comment, as the head is read
|
|
122
|
+
if (id !== null)
|
|
123
|
+
this.dropped.set(id, why);
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
/** A referent by its material type when it could be read; one that could not is named so, not blamed for its materials. */
|
|
127
|
+
referentName(id) {
|
|
128
|
+
const type = this.source.typeOf(id);
|
|
129
|
+
return type?.startsWith('IFCMATERIAL') && this.source.slots(id) ? type : 'an unread record';
|
|
130
|
+
}
|
|
131
|
+
/** Whether `apply` left record `id` out. */
|
|
132
|
+
leftOut(id) { return this.dropped.has(id); }
|
|
133
|
+
warnings() {
|
|
134
|
+
if (!this.dropped.size)
|
|
135
|
+
return [];
|
|
136
|
+
const sites = [...this.dropped].sort(([a], [b]) => a - b).map(([id, type]) => `#${id} (${type})`);
|
|
137
|
+
return [`${this.dropped.size} IfcMaterialProperties record(s) were not written: IFC2X3 IfcExtendedMaterialProperties.Material must name one IfcMaterial, and theirs does not: ${sites.join(', ')} (#10763).`];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The IfcMaterialProperties records of `store` an IFC4/IFC4X3 -> IFC2X3
|
|
142
|
+
* export leaves out, with their attribute names, for the loss report.
|
|
143
|
+
*/
|
|
144
|
+
export function materialPropertiesNotWritten(store, from, to) {
|
|
145
|
+
const attributes = attrNameTable(from)?.get(PROPERTIES) ?? [];
|
|
146
|
+
// As `apply`: no downgrade, or no Material to check, writes each one.
|
|
147
|
+
if (!downgradesMaterial(from, to) || !attributes.includes('Material'))
|
|
148
|
+
return { ids: [], attributes };
|
|
149
|
+
const { entityIndex, deferredEntityIndex, source: bytes } = store;
|
|
150
|
+
// Without the bytes (none, or a sourceless store's empty buffer) no record can be checked: the report is
|
|
151
|
+
// pessimistic and names each, as a bare `convertStepLine` leaves each out. An export needs the bytes.
|
|
152
|
+
if (!bytes?.byteLength) {
|
|
153
|
+
// @raw-entity-enumeration-ok type-only loss preview without source records
|
|
154
|
+
return { ids: [...new Set(entityIndex.byType.get(PROPERTIES))], attributes };
|
|
155
|
+
}
|
|
156
|
+
// The writer's own decision for the source as parsed: each record through the `apply` the export runs.
|
|
157
|
+
const source = new SourceRecords({ entityIndex, deferredEntityIndex, source: bytes });
|
|
158
|
+
const referents = new MaterialReferents({ typeOf: (id) => source.type(id), slots: (id) => source.slots(id) });
|
|
159
|
+
return { ids: source.ids(PROPERTIES).filter((id) => { const text = source.text(id); return text === undefined || referents.apply(text, from, to) === null; }), attributes };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Arms `materials` with a merged model's records (#10763) and returns the
|
|
163
|
+
* model's `written` predicate, for the merge loop: its `written` local ids
|
|
164
|
+
* under `offset`, their text remapped as the merge remaps it. Material records
|
|
165
|
+
* are never shared infrastructure, so a merged id is the local id plus the offset.
|
|
166
|
+
*/
|
|
167
|
+
export function armMergedModel(materials, store, written, offset, sharedRemap) {
|
|
168
|
+
const source = new SourceRecords(store);
|
|
169
|
+
const local = (id) => (id > offset && written(id - offset) ? id - offset : null);
|
|
170
|
+
const read = new Map();
|
|
171
|
+
materials.rearm({
|
|
172
|
+
typeOf: (id) => { const l = local(id); return l === null ? undefined : source.type(l); },
|
|
173
|
+
gone: (id) => local(id) === null && id > offset && !!source.type(id - offset)?.startsWith('IFCMATERIAL'),
|
|
174
|
+
slots: (id) => {
|
|
175
|
+
if (!read.has(id)) {
|
|
176
|
+
const l = local(id), text = l === null ? undefined : source.text(l);
|
|
177
|
+
read.set(id, text === undefined ? undefined : readStepSlots(remapEntityText(text, offset, sharedRemap))?.slots);
|
|
178
|
+
}
|
|
179
|
+
return read.get(id);
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
return written;
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=schema-converter-material-referent.js.map
|
|
@@ -0,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AAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC;QACxG,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;YACZ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBAClB,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YAClH,CAAC;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -30,7 +30,7 @@ export declare class OwnerHistoryFill {
|
|
|
30
30
|
* `TYPE` is an `IfcRoot` subtype and the slot is `$`. Every other byte of
|
|
31
31
|
* the line is kept; a line that does not parse is returned unchanged.
|
|
32
32
|
*/
|
|
33
|
-
apply(line: string): string;
|
|
33
|
+
apply(line: string, maxReferenceId?: number): string;
|
|
34
34
|
/** The warning for {@link unfilled}, or none when every slot was filled.
|
|
35
35
|
* Same text as the Rust twin's. */
|
|
36
36
|
unfilledWarnings(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-owner-history.d.ts","sourceRoot":"","sources":["../src/schema-converter-owner-history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-converter-owner-history.d.ts","sourceRoot":"","sources":["../src/schema-converter-owner-history.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,gBAAgB;IAC3B;qCACiC;IACjC,QAAQ,SAAK;IAEb;yEACqE;IACrE,OAAO,CAAC,GAAG,CAAuB;IAElC;;gEAE4D;IAC5D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIhC;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM;IAgBpD;wCACoC;IACpC,gBAAgB,IAAI,MAAM,EAAE;CAO7B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAClC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAChC,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,IAAI,CAGf"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { withoutComments } from './step-comment-skip.js';
|
|
4
5
|
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
5
6
|
import { isRootedType } from './merged-guid.js';
|
|
6
7
|
/** {@link isRootedType} per type name: `apply` asks once per converted line,
|
|
@@ -49,7 +50,7 @@ export class OwnerHistoryFill {
|
|
|
49
50
|
* `TYPE` is an `IfcRoot` subtype and the slot is `$`. Every other byte of
|
|
50
51
|
* the line is kept; a line that does not parse is returned unchanged.
|
|
51
52
|
*/
|
|
52
|
-
apply(line) {
|
|
53
|
+
apply(line, maxReferenceId) {
|
|
53
54
|
const open = line.indexOf('(');
|
|
54
55
|
const close = line.lastIndexOf(')');
|
|
55
56
|
const eq = line.indexOf('=');
|
|
@@ -57,8 +58,8 @@ export class OwnerHistoryFill {
|
|
|
57
58
|
return line;
|
|
58
59
|
if (!isRooted(line.slice(eq + 1, open).trim()))
|
|
59
60
|
return line;
|
|
60
|
-
const slots = splitTopLevelStepArguments(line.slice(open + 1, close));
|
|
61
|
-
if (slots === null || slots.length < 2 || slots[1]
|
|
61
|
+
const slots = splitTopLevelStepArguments(line.slice(open + 1, close), maxReferenceId);
|
|
62
|
+
if (slots === null || slots.length < 2 || withoutComments(slots[1]) !== '$')
|
|
62
63
|
return line;
|
|
63
64
|
if (this.ref === null) {
|
|
64
65
|
this.unfilled++;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-owner-history.js","sourceRoot":"","sources":["../src/schema-converter-owner-history.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;mDACmD;AACnD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAmB,CAAC;AAElD,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAC5B,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,gBAAgB;IAC3B;qCACiC;IACjC,QAAQ,GAAG,CAAC,CAAC;IAEb;yEACqE;IAC7D,GAAG,GAAkB,IAAI,CAAC;IAElC;;gEAE4D;IAC5D,MAAM,CAAC,GAAkB;QACvB,IAAI,GAAG,KAAK,IAAI;YAAE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAY;
|
|
1
|
+
{"version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