@ifc-lite/export 5.0.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/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/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +73 -71
- package/dist/merged-exporter.js.map +1 -1
- 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-remap.d.ts +1 -1
- package/dist/merged-remap.d.ts.map +1 -1
- package/dist/merged-remap.js +5 -1
- package/dist/merged-remap.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 +7 -12
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +89 -56
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-attr-maps.d.ts +12 -0
- package/dist/schema-converter-attr-maps.d.ts.map +1 -1
- package/dist/schema-converter-attr-maps.js +51 -7
- package/dist/schema-converter-attr-maps.js.map +1 -1
- 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 +4 -4
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter-document-links.d.ts +1 -1
- package/dist/schema-converter-document-links.d.ts.map +1 -1
- package/dist/schema-converter-document-links.js +2 -2
- package/dist/schema-converter-document-links.js.map +1 -1
- 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 +8 -1
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +17 -7
- 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-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-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 +1 -1
- package/dist/schema-converter-structural-axes.d.ts.map +1 -1
- package/dist/schema-converter-structural-axes.js +2 -2
- package/dist/schema-converter-structural-axes.js.map +1 -1
- package/dist/schema-converter-structural-carriers.d.ts +2 -0
- package/dist/schema-converter-structural-carriers.d.ts.map +1 -1
- package/dist/schema-converter-structural-carriers.js +6 -0
- package/dist/schema-converter-structural-carriers.js.map +1 -1
- package/dist/schema-converter-structural-diagnostics.d.ts +7 -0
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -1
- package/dist/schema-converter-structural-diagnostics.js +18 -0
- package/dist/schema-converter-structural-diagnostics.js.map +1 -1
- package/dist/schema-converter-structural-source.d.ts +7 -0
- package/dist/schema-converter-structural-source.d.ts.map +1 -1
- package/dist/schema-converter-structural-source.js +16 -6
- package/dist/schema-converter-structural-source.js.map +1 -1
- package/dist/schema-converter-structural-varying.d.ts +5 -0
- package/dist/schema-converter-structural-varying.d.ts.map +1 -1
- package/dist/schema-converter-structural-varying.js +24 -11
- package/dist/schema-converter-structural-varying.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 +1 -1
- package/dist/schema-converter-userdefined-label.d.ts.map +1 -1
- package/dist/schema-converter-userdefined-label.js +7 -6
- package/dist/schema-converter-userdefined-label.js.map +1 -1
- package/dist/schema-converter-value-forms.d.ts +9 -1
- package/dist/schema-converter-value-forms.d.ts.map +1 -1
- package/dist/schema-converter-value-forms.js +55 -18
- package/dist/schema-converter-value-forms.js.map +1 -1
- package/dist/schema-converter.d.ts +8 -11
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +51 -49
- package/dist/schema-converter.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 +1 -1
- package/dist/schema-value-form-policy.d.ts.map +1 -1
- package/dist/schema-value-form-policy.js +37 -4
- package/dist/schema-value-form-policy.js.map +1 -1
- 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-comment-skip.d.ts.map +1 -1
- package/dist/step-comment-skip.js +3 -1
- package/dist/step-comment-skip.js.map +1 -1
- package/dist/step-export-types.d.ts +3 -6
- 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.map +1 -1
- package/dist/step-exporter.js +10 -6
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-georeferencing.d.ts.map +1 -1
- package/dist/step-georeferencing.js +4 -17
- package/dist/step-georeferencing.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-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +47 -1
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-ref-scan.d.ts +5 -0
- package/dist/step-ref-scan.d.ts.map +1 -1
- package/dist/step-ref-scan.js +1 -1
- package/dist/step-ref-scan.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 +2 -6
- 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 +19 -10
- package/dist/unit-normalize.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
import { IFC2X3_TYPED_PROPERTIES } from './generated/ifc2x3-typed-properties.js';
|
|
3
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
4
|
+
import { slotRef, slotUnset } from './schema-converter-structural-source.js';
|
|
5
|
+
import { getMaxExpressId } from './entity-iteration.js';
|
|
6
|
+
import { stepRecordHead } from './step-record-frame.js';
|
|
7
|
+
import { decodeRange } from './source-ref-bounds.js';
|
|
8
|
+
import { MAX_SOURCE_STEP_ID, isStepValue, parseStepNumber, skipStepTrivia } from './step-slot-grammar.js';
|
|
9
|
+
let rows;
|
|
10
|
+
function rowFor(type) {
|
|
11
|
+
return (rows ??= new Map(IFC2X3_TYPED_PROPERTIES.map((row) => [row[0], row]))).get(type);
|
|
12
|
+
}
|
|
13
|
+
export function isTypedPropertyUpgrade(type, from, to) {
|
|
14
|
+
return from === 'IFC2X3' && (to === 'IFC4' || to === 'IFC4X3') && rowFor(type) !== undefined;
|
|
15
|
+
}
|
|
16
|
+
// Recognize complete UTF-8 scalars so invalid bytes can retain their Latin-1
|
|
17
|
+
// meaning without changing adjacent valid UTF-8.
|
|
18
|
+
const UTF8_MULTIBYTE = /[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xec\xee-\xef][\x80-\xbf]{2}|\xed[\x80-\x9f][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf]{2}|[\xf1-\xf3][\x80-\xbf]{3}|\xf4[\x80-\x8f][\x80-\xbf]{2}/g;
|
|
19
|
+
export function decodeTypedPropertyRecord(source, ref, from, to) {
|
|
20
|
+
const end = ref.byteOffset + ref.byteLength;
|
|
21
|
+
const decoded = decodeRange(source, ref.byteOffset, end);
|
|
22
|
+
if (from !== 'IFC2X3' || (to !== 'IFC4' && to !== 'IFC4X3') || !decoded.includes('�')) {
|
|
23
|
+
return decoded;
|
|
24
|
+
}
|
|
25
|
+
const row = rowFor(ref.type.toUpperCase());
|
|
26
|
+
if (!row?.[2].some(([, fields]) => fields.some((field) => field.kind === 'text'))) {
|
|
27
|
+
return decoded;
|
|
28
|
+
}
|
|
29
|
+
const decoder = new TextDecoder('utf-8', { ignoreBOM: true });
|
|
30
|
+
const byteString = Array.from(source.slice(ref.byteOffset, end), (byte) => String.fromCharCode(byte)).join('');
|
|
31
|
+
return byteString.replace(UTF8_MULTIBYTE, (sequence) => decoder.decode(Uint8Array.from(sequence, (char) => char.charCodeAt(0))));
|
|
32
|
+
}
|
|
33
|
+
function idOf(line) {
|
|
34
|
+
return Number(/^#(\d+)/.exec(line.slice(skipStepTrivia(line, 0)))?.[1]);
|
|
35
|
+
}
|
|
36
|
+
function wraps(value, field) {
|
|
37
|
+
if (field.kind === 'number')
|
|
38
|
+
return Number.isFinite(parseStepNumber(value));
|
|
39
|
+
const start = skipStepTrivia(value, 0);
|
|
40
|
+
if (field.kind === 'text')
|
|
41
|
+
return value[start] === "'" && isStepValue(value);
|
|
42
|
+
return /^(?:\.T\.|\.F\.)/i.test(value.slice(start))
|
|
43
|
+
&& skipStepTrivia(value, start + 3) === value.length;
|
|
44
|
+
}
|
|
45
|
+
function writableGroups(row, slots) {
|
|
46
|
+
return row[2].flatMap(([name, fields]) => {
|
|
47
|
+
const values = fields.filter((field) => wraps(slots[field.index], field));
|
|
48
|
+
return values.length ? [{ name, fields: values }] : [];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function nextAfterProperties(next, groupSizes, maxId = MAX_SOURCE_STEP_ID) {
|
|
52
|
+
if (!groupSizes.length)
|
|
53
|
+
return undefined;
|
|
54
|
+
const size = groupSizes.reduce((total, count) => total + count + 1, -1);
|
|
55
|
+
return size - 1 <= maxId - next ? next + size : undefined;
|
|
56
|
+
}
|
|
57
|
+
/** Allocate in source iteration order as the default full STEP export does. */
|
|
58
|
+
export function previewTypedPropertyNames(records, index, candidates) {
|
|
59
|
+
const byId = new Map(candidates.flatMap((candidate) => candidate.ids.map((id) => [id, candidate])));
|
|
60
|
+
const retained = new Map();
|
|
61
|
+
if (!byId.size)
|
|
62
|
+
return retained;
|
|
63
|
+
let next = getMaxExpressId(index) + 1;
|
|
64
|
+
for (const [id] of index) {
|
|
65
|
+
const candidate = byId.get(id);
|
|
66
|
+
if (!candidate)
|
|
67
|
+
continue;
|
|
68
|
+
const slots = records.slots(id);
|
|
69
|
+
const row = rowFor(candidate.type);
|
|
70
|
+
if (!slots || !row || slots.length !== row[1])
|
|
71
|
+
continue;
|
|
72
|
+
const names = new Set(row[2].flatMap(([, fields]) => fields
|
|
73
|
+
.filter((field) => slotUnset(slots[field.index]))
|
|
74
|
+
.map((field) => field.sourceName)));
|
|
75
|
+
if (slotRef(slots[candidate.referenceSlot]) !== null) {
|
|
76
|
+
const groups = writableGroups(row, slots);
|
|
77
|
+
const end = nextAfterProperties(next, groups.map(({ fields }) => fields.length));
|
|
78
|
+
if (end !== undefined) {
|
|
79
|
+
next = end;
|
|
80
|
+
for (const group of groups)
|
|
81
|
+
for (const field of group.fields)
|
|
82
|
+
names.add(field.sourceName);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
retained.set(id, names);
|
|
86
|
+
}
|
|
87
|
+
return retained;
|
|
88
|
+
}
|
|
89
|
+
/** Collect effective source values while writing, then allocate ids above all
|
|
90
|
+
* emitted records (including federation offsets and synthesized atoms). */
|
|
91
|
+
export class TypedPropertyUpgrade {
|
|
92
|
+
enabled;
|
|
93
|
+
refused = 0;
|
|
94
|
+
drafts = new Map();
|
|
95
|
+
constructor(enabled) {
|
|
96
|
+
this.enabled = enabled;
|
|
97
|
+
}
|
|
98
|
+
capture(source, converted, from, to, maxReferenceId = MAX_SOURCE_STEP_ID) {
|
|
99
|
+
if (!this.enabled || from !== 'IFC2X3' || (to !== 'IFC4' && to !== 'IFC4X3'))
|
|
100
|
+
return false;
|
|
101
|
+
const head = stepRecordHead(source);
|
|
102
|
+
const sourceType = head ? source.slice(head.typeStart, head.typeEnd).toUpperCase() : '';
|
|
103
|
+
const row = rowFor(sourceType);
|
|
104
|
+
if (!row)
|
|
105
|
+
return false;
|
|
106
|
+
const input = readStepSlots(source, maxReferenceId);
|
|
107
|
+
if (!input || input.slots.length !== row[1])
|
|
108
|
+
return false;
|
|
109
|
+
const groups = writableGroups(row, input.slots).map(({ name, fields }) => ({
|
|
110
|
+
name,
|
|
111
|
+
properties: fields.map((field) => {
|
|
112
|
+
const value = input.slots[field.index];
|
|
113
|
+
return { attribute: field.sourceName, record: `IFCPROPERTYSINGLEVALUE('${field.name}',$,${field.valueType}(${value}),$);` };
|
|
114
|
+
}),
|
|
115
|
+
}));
|
|
116
|
+
const id = idOf(converted);
|
|
117
|
+
if (!groups.length || !(id <= maxReferenceId))
|
|
118
|
+
return false;
|
|
119
|
+
this.drafts.set(id, { sourceType, to, groups });
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
warnings() {
|
|
123
|
+
return this.refused ? [`${this.refused} typed property record(s) could not be preserved because the target reference is missing or the export has run out of STEP ids (#10797).`] : [];
|
|
124
|
+
}
|
|
125
|
+
finish(lines, slots, firstAvailableId, structural, maxReferenceId = MAX_SOURCE_STEP_ID) {
|
|
126
|
+
if (this.drafts.size === 0)
|
|
127
|
+
return firstAvailableId;
|
|
128
|
+
const extra = [];
|
|
129
|
+
let next = firstAvailableId;
|
|
130
|
+
for (const line of lines) {
|
|
131
|
+
const id = idOf(line);
|
|
132
|
+
if (id >= next)
|
|
133
|
+
next = id + 1;
|
|
134
|
+
}
|
|
135
|
+
const rewritten = (line, draft) => {
|
|
136
|
+
const record = readStepSlots(line, maxReferenceId);
|
|
137
|
+
const end = nextAfterProperties(next, draft.groups.map((group) => group.properties.length), maxReferenceId);
|
|
138
|
+
if (!record || record.slots.length !== 4 || slotRef(record.slots[3]) === null
|
|
139
|
+
|| end === undefined) {
|
|
140
|
+
this.refused++;
|
|
141
|
+
return line;
|
|
142
|
+
}
|
|
143
|
+
let parent = line;
|
|
144
|
+
for (const [index, group] of draft.groups.entries()) {
|
|
145
|
+
const refs = group.properties.map((property) => {
|
|
146
|
+
const ref = `#${next++}`;
|
|
147
|
+
extra.push(`${ref}=${property.record}`);
|
|
148
|
+
structural.restoreOmittedValue(draft.sourceType, property.attribute, draft.to);
|
|
149
|
+
return ref;
|
|
150
|
+
});
|
|
151
|
+
const args = `'${group.name}',$,(${refs.join(',')}),${record.slots[3]}`;
|
|
152
|
+
if (index === 0)
|
|
153
|
+
parent = `${record.prefix}${args}${record.suffix}`;
|
|
154
|
+
else
|
|
155
|
+
extra.push(`#${next++}=${record.type}(${args});`);
|
|
156
|
+
}
|
|
157
|
+
return parent;
|
|
158
|
+
};
|
|
159
|
+
for (let index = 0; index < lines.length; index++) {
|
|
160
|
+
const draft = this.drafts.get(idOf(lines[index]));
|
|
161
|
+
if (!draft)
|
|
162
|
+
continue;
|
|
163
|
+
lines[index] = rewritten(lines[index], draft);
|
|
164
|
+
if (draft.to === 'IFC4')
|
|
165
|
+
slots.apply(lines[index]);
|
|
166
|
+
}
|
|
167
|
+
for (const line of extra)
|
|
168
|
+
lines.push(line);
|
|
169
|
+
this.drafts.clear();
|
|
170
|
+
return next;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=schema-converter-typed-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-typed-properties.js","sourceRoot":"","sources":["../src/schema-converter-typed-properties.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAGtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAsB,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,eAAe,EAA4B,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,O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AAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IfcSchemaVersion } from './schema-converter.js';
|
|
2
|
+
import { type SourceStore } from './schema-converter-structural-source.js';
|
|
3
|
+
export declare function removesObsoleteResources(from: IfcSchemaVersion, to: IfcSchemaVersion): boolean;
|
|
4
|
+
/** Written STEP ids include safe-integer merge offsets; source indexes remain u32. */
|
|
5
|
+
export declare function outputRecordId(line: string): number;
|
|
6
|
+
/** Collect direct omissions only from the source model that is being upgraded. */
|
|
7
|
+
export declare function noteUpgradeSeed(line: string, seeds: Set<number>, from: IfcSchemaVersion, to: IfcSchemaVersion): void;
|
|
8
|
+
/** Preview required-reference losses on the target layouts of an unedited source. */
|
|
9
|
+
export declare function previewUpgradeDependents(store: SourceStore, from: IfcSchemaVersion, to: IfcSchemaVersion): Set<number>;
|
|
10
|
+
/** Run after conversion so every reference is in the final id space and slot. */
|
|
11
|
+
export declare function pruneUpgrade(lines: string[], seeds: ReadonlySet<number>, to: IfcSchemaVersion, onOmitted?: (id: number) => void): string[];
|
|
12
|
+
/** Single-model output contains only converted records, including pending edits. */
|
|
13
|
+
export declare function pruneUpgradeFromSource(lines: string[], from: IfcSchemaVersion, to: IfcSchemaVersion, onOmitted: (id: number) => void): string[];
|
|
14
|
+
//# sourceMappingURL=schema-converter-unrooted-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-unrooted-upgrade.d.ts","sourceRoot":"","sources":["../src/schema-converter-unrooted-upgrade.ts"],"names":[],"mappings":"AAQA,OAAO,EAAsC,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGlG,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,yCAAyC,CAAC;AA0B1F,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAE9F;AAED,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnD;AAaD,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,GAAG,IAAI,CAUpH;AA2ED,qFAAqF;AACrF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,CAmCtH;AAcD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,EAAE,CAiB1I;AAGD,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,EAAE,CAK/I"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
3
|
+
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
4
|
+
import { frameArgs, stepRecordHead, stepRecordFrame, withFrameArgs } from './step-record-frame.js';
|
|
5
|
+
import { forEachExpressRef, referencesAnyExpressId } from './step-ref-scan.js';
|
|
6
|
+
import { isRootedEntityType, missingTypeRoute, VERBATIM_UPGRADE } from './schema-untranslatable.js';
|
|
7
|
+
import { varyingTarget } from './schema-converter-structural-varying.js';
|
|
8
|
+
import { convertEntityType, convertStepLine } from './schema-converter.js';
|
|
9
|
+
import { EnumReconciliation } from './schema-converter-enums.js';
|
|
10
|
+
import { getCompleteEntityIndex, getMaxExpressId } from './entity-iteration.js';
|
|
11
|
+
import { SourceRecords } from './schema-converter-structural-source.js';
|
|
12
|
+
import { StyleFlatten } from './schema-style-flatten.js';
|
|
13
|
+
import { isStepValue, skipStepTrivia } from './step-slot-grammar.js';
|
|
14
|
+
const layouts = new Map();
|
|
15
|
+
function attributes(type, schema) {
|
|
16
|
+
let table = layouts.get(schema);
|
|
17
|
+
if (!table) {
|
|
18
|
+
table = new Map(Object.entries(getSchemaRegistryForVersion(schema).entities).map(([name, info]) => [
|
|
19
|
+
name.toUpperCase(), info.allAttributes ?? info.attributes,
|
|
20
|
+
]));
|
|
21
|
+
layouts.set(schema, table);
|
|
22
|
+
}
|
|
23
|
+
return table.get(type);
|
|
24
|
+
}
|
|
25
|
+
export function removesObsoleteResources(from, to) {
|
|
26
|
+
return (from === 'IFC2X3' && (to === 'IFC4' || to === 'IFC4X3')) || (from === 'IFC4' && to === 'IFC4X3');
|
|
27
|
+
}
|
|
28
|
+
/** Written STEP ids include safe-integer merge offsets; source indexes remain u32. */
|
|
29
|
+
export function outputRecordId(line) {
|
|
30
|
+
const start = skipStepTrivia(line, 0);
|
|
31
|
+
return Number(/^#(\d+)/.exec(line.slice(start))?.[1]);
|
|
32
|
+
}
|
|
33
|
+
function record(line) {
|
|
34
|
+
const head = stepRecordHead(line);
|
|
35
|
+
if (head === null)
|
|
36
|
+
return undefined;
|
|
37
|
+
const id = outputRecordId(line);
|
|
38
|
+
if (!Number.isSafeInteger(id))
|
|
39
|
+
return undefined;
|
|
40
|
+
const type = line.slice(head.typeStart, head.typeEnd).toUpperCase();
|
|
41
|
+
const frame = stepRecordFrame(line);
|
|
42
|
+
const raw = frame ? frameArgs(line, frame) : line.slice(head.open + 1);
|
|
43
|
+
return { id, type, line, raw, frame };
|
|
44
|
+
}
|
|
45
|
+
/** Collect direct omissions only from the source model that is being upgraded. */
|
|
46
|
+
export function noteUpgradeSeed(line, seeds, from, to) {
|
|
47
|
+
if (!removesObsoleteResources(from, to))
|
|
48
|
+
return;
|
|
49
|
+
const head = stepRecordHead(line);
|
|
50
|
+
if (!head)
|
|
51
|
+
return;
|
|
52
|
+
const type = line.slice(head.typeStart, head.typeEnd).toUpperCase();
|
|
53
|
+
if (from === 'IFC5' || to === 'IFC5')
|
|
54
|
+
return;
|
|
55
|
+
const route = missingTypeRoute(type, from, to, attributes(type, from) !== undefined, attributes(type, to) !== undefined);
|
|
56
|
+
if (route !== 'omitted')
|
|
57
|
+
return;
|
|
58
|
+
const id = outputRecordId(line);
|
|
59
|
+
if (Number.isSafeInteger(id))
|
|
60
|
+
seeds.add(id);
|
|
61
|
+
}
|
|
62
|
+
function listMembers(value) {
|
|
63
|
+
const open = skipStepTrivia(value, 0);
|
|
64
|
+
if (value[open] !== '(' || !isStepValue(value, Number.MAX_SAFE_INTEGER))
|
|
65
|
+
return null;
|
|
66
|
+
// isStepValue verifies that the outer list is followed only by STEP trivia.
|
|
67
|
+
// Look past its comments before choosing the closing parenthesis.
|
|
68
|
+
let end = value.length;
|
|
69
|
+
while (end > open) {
|
|
70
|
+
const close = value.lastIndexOf(')', end - 1);
|
|
71
|
+
if (close <= open)
|
|
72
|
+
return null;
|
|
73
|
+
if (skipStepTrivia(value, close + 1) === value.length) {
|
|
74
|
+
const items = splitTopLevelStepArguments(value.slice(open + 1, close), Number.MAX_SAFE_INTEGER);
|
|
75
|
+
if (items !== null)
|
|
76
|
+
return items;
|
|
77
|
+
}
|
|
78
|
+
end = close;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
function slot(value, attribute, narrowAggregates = true) {
|
|
83
|
+
const members = narrowAggregates && (attribute?.isList || attribute?.isSet) ? listMembers(value) : null;
|
|
84
|
+
return { value, members, optional: attribute?.optional ?? false, minimum: members ? attribute?.arrayBounds?.[0] ?? 1 : 1 };
|
|
85
|
+
}
|
|
86
|
+
function readSlots(rec, to) {
|
|
87
|
+
const values = rec.frame ? splitTopLevelStepArguments(rec.raw, Number.MAX_SAFE_INTEGER) : null;
|
|
88
|
+
const target = attributes(rec.type, to);
|
|
89
|
+
// Verbatim records and varying actions left unconverted in IFC4 keep their
|
|
90
|
+
// IFC2X3 optional slots. Check their aggregates as whole slots.
|
|
91
|
+
const retainedLegacy = target === undefined
|
|
92
|
+
&& (VERBATIM_UPGRADE.has(rec.type) || (to === 'IFC4' && varyingTarget(rec.type) !== undefined));
|
|
93
|
+
const layout = target ?? (retainedLegacy ? attributes(rec.type, 'IFC2X3') : undefined);
|
|
94
|
+
if (!values || !layout || values.length !== layout.length)
|
|
95
|
+
return undefined;
|
|
96
|
+
// Sectioned-spine sections and positions correspond by index. Withhold on any loss.
|
|
97
|
+
const narrow = target !== undefined && rec.type !== 'IFCSECTIONEDSPINE';
|
|
98
|
+
return values.map((value, index) => slot(value, layout[index], narrow));
|
|
99
|
+
}
|
|
100
|
+
function indexRequiredMembers(rec, users, to) {
|
|
101
|
+
// Without a usable layout a lost reference makes the record unsafe to keep.
|
|
102
|
+
for (const part of readSlots(rec, to) ?? [slot(rec.raw)]) {
|
|
103
|
+
if (part.optional || part.minimum === 0)
|
|
104
|
+
continue;
|
|
105
|
+
const members = part.members ?? [part.value];
|
|
106
|
+
const group = { id: rec.id, remaining: members.length, minimum: part.minimum };
|
|
107
|
+
for (const value of members) {
|
|
108
|
+
let member;
|
|
109
|
+
forEachExpressRef(value, (ref) => {
|
|
110
|
+
const entries = users.get(ref) ?? [];
|
|
111
|
+
entries.push(member ??= { group, lost: false });
|
|
112
|
+
users.set(ref, entries);
|
|
113
|
+
return false;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function cascadeOmissions(records, seeds, to) {
|
|
119
|
+
const dropped = new Set(seeds);
|
|
120
|
+
const users = new Map();
|
|
121
|
+
for (const rec of records) {
|
|
122
|
+
if (rec && !dropped.has(rec.id))
|
|
123
|
+
indexRequiredMembers(rec, users, to);
|
|
124
|
+
}
|
|
125
|
+
// Set iteration visits newly inserted ids. Each reference edge is visited
|
|
126
|
+
// once. A member that names several dropped records counts as one loss.
|
|
127
|
+
for (const id of dropped) {
|
|
128
|
+
for (const member of users.get(id) ?? []) {
|
|
129
|
+
if (member.lost || dropped.has(member.group.id))
|
|
130
|
+
continue;
|
|
131
|
+
member.lost = true;
|
|
132
|
+
if (--member.group.remaining < member.group.minimum)
|
|
133
|
+
dropped.add(member.group.id);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return dropped;
|
|
137
|
+
}
|
|
138
|
+
/** Preview required-reference losses on the target layouts of an unedited source. */
|
|
139
|
+
export function previewUpgradeDependents(store, from, to) {
|
|
140
|
+
const seeds = new Set();
|
|
141
|
+
if (!removesObsoleteResources(from, to) || from === 'IFC5' || (to !== 'IFC4' && to !== 'IFC4X3'))
|
|
142
|
+
return seeds;
|
|
143
|
+
const routeOf = (type) => missingTypeRoute(type, from, to, attributes(type, from) !== undefined, attributes(convertEntityType(type, from, to), to) !== undefined);
|
|
144
|
+
const source = new SourceRecords(store);
|
|
145
|
+
// @raw-entity-enumeration-ok enumerate the kinds in the unedited parsed source; SourceRecords supplies the kept IDs
|
|
146
|
+
for (const type of store.entityIndex.byType.keys()) {
|
|
147
|
+
if (routeOf(type.toUpperCase()) === 'omitted')
|
|
148
|
+
for (const id of source.ids(type))
|
|
149
|
+
seeds.add(id);
|
|
150
|
+
}
|
|
151
|
+
if (seeds.size === 0)
|
|
152
|
+
return seeds;
|
|
153
|
+
const styles = StyleFlatten.fromStore(store, from, to);
|
|
154
|
+
const enums = new EnumReconciliation(true, [store]);
|
|
155
|
+
enums.structural.fromStore(store, from, to, source);
|
|
156
|
+
let nextId = getMaxExpressId(getCompleteEntityIndex(store)) + 1;
|
|
157
|
+
enums.structural.ids = () => nextId++;
|
|
158
|
+
function* projectedRecords() {
|
|
159
|
+
for (const { id, text } of source.texts()) {
|
|
160
|
+
if (seeds.has(id))
|
|
161
|
+
continue;
|
|
162
|
+
const line = styles ? styles.apply(text) : text;
|
|
163
|
+
if (line === null)
|
|
164
|
+
continue;
|
|
165
|
+
const parsed = record(line);
|
|
166
|
+
if (!parsed || (routeOf(parsed.type) === 'unrepresented' && !isRootedEntityType(parsed.type)))
|
|
167
|
+
continue;
|
|
168
|
+
// The report can still describe other losses when a malformed record would abort the export.
|
|
169
|
+
if (parsed.frame && splitTopLevelStepArguments(parsed.raw) !== null) {
|
|
170
|
+
const converted = convertStepLine(line, from, to, undefined, undefined, undefined, undefined, enums);
|
|
171
|
+
if (converted !== null)
|
|
172
|
+
yield converted === line ? parsed : record(converted);
|
|
173
|
+
}
|
|
174
|
+
else
|
|
175
|
+
yield parsed;
|
|
176
|
+
}
|
|
177
|
+
yield* enums.structural.added().map(record);
|
|
178
|
+
}
|
|
179
|
+
const dropped = cascadeOmissions(projectedRecords(), seeds, to);
|
|
180
|
+
for (const id of seeds)
|
|
181
|
+
dropped.delete(id);
|
|
182
|
+
return dropped;
|
|
183
|
+
}
|
|
184
|
+
function rewrite(rec, dropped, to) {
|
|
185
|
+
if (!rec.frame || !referencesAnyExpressId(rec.raw, dropped))
|
|
186
|
+
return rec.line;
|
|
187
|
+
const parts = readSlots(rec, to);
|
|
188
|
+
if (!parts)
|
|
189
|
+
return rec.line;
|
|
190
|
+
const kept = parts.map(({ value, members, minimum }) => {
|
|
191
|
+
if (!referencesAnyExpressId(value, dropped))
|
|
192
|
+
return value;
|
|
193
|
+
const filtered = members?.filter((member) => !referencesAnyExpressId(member, dropped));
|
|
194
|
+
return filtered && filtered.length >= minimum ? `(${filtered.join(',')})` : '$';
|
|
195
|
+
});
|
|
196
|
+
return withFrameArgs(rec.line, rec.frame, kept.join(','));
|
|
197
|
+
}
|
|
198
|
+
/** Run after conversion so every reference is in the final id space and slot. */
|
|
199
|
+
export function pruneUpgrade(lines, seeds, to, onOmitted) {
|
|
200
|
+
if (seeds.size === 0 || (to !== 'IFC4' && to !== 'IFC4X3'))
|
|
201
|
+
return [];
|
|
202
|
+
const records = lines.map(record);
|
|
203
|
+
const dropped = cascadeOmissions(records, seeds, to);
|
|
204
|
+
const warnings = [];
|
|
205
|
+
let next = 0;
|
|
206
|
+
for (const [index, rec] of records.entries()) {
|
|
207
|
+
if (rec && dropped.has(rec.id)) {
|
|
208
|
+
onOmitted?.(rec.id);
|
|
209
|
+
const reason = seeds.has(rec.id) ? `the ${to} schema does not declare its type` : `a required ${to} attribute lost a reference`;
|
|
210
|
+
warnings.push(`#${rec.id} (${rec.type}) was omitted because ${reason} (#${to === 'IFC4' ? 10970 : 10971}).`);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
lines[next++] = rec ? rewrite(rec, dropped, to) : lines[index];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
lines.length = next;
|
|
217
|
+
return warnings;
|
|
218
|
+
}
|
|
219
|
+
/** Single-model output contains only converted records, including pending edits. */
|
|
220
|
+
export function pruneUpgradeFromSource(lines, from, to, onOmitted) {
|
|
221
|
+
if (!removesObsoleteResources(from, to))
|
|
222
|
+
return [];
|
|
223
|
+
const seeds = new Set();
|
|
224
|
+
for (const line of lines)
|
|
225
|
+
noteUpgradeSeed(line, seeds, from, to);
|
|
226
|
+
return pruneUpgrade(lines, seeds, to, onOmitted);
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=schema-converter-unrooted-upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-unrooted-upgrade.js","sourceRoot":"","sources":["../src/schema-converter-unrooted-upgrade.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC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,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAGD,oFAAoF;AACpF,MAAM,UAAU,sBAAsB,CAAC,KAAe,EAAE,IAAsB,EAAE,EAAoB,EAAE,SAA+B;IACnI,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAAE,CAAC;QAAE,OAAO,EAAE,CAAC;IACnD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACjE,OAAO,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -4,5 +4,5 @@ export declare function isToken(slot: string | undefined, token: string): boolea
|
|
|
4
4
|
/** No value: `$`, `*` or nothing, comments aside. A missing slot is not unset. */
|
|
5
5
|
export declare const isUnset: (slot: string | undefined) => boolean;
|
|
6
6
|
/** `converted`, written from `source` between the schemas, with the label carried. */
|
|
7
|
-
export declare function carryUserDefinedLabel(source: string, converted: string | null, fromSchema: IfcSchemaVersion, toSchema: IfcSchemaVersion): string | null;
|
|
7
|
+
export declare function carryUserDefinedLabel(source: string, converted: string | null, fromSchema: IfcSchemaVersion, toSchema: IfcSchemaVersion, maxReferenceId?: number): string | null;
|
|
8
8
|
//# sourceMappingURL=schema-converter-userdefined-label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-userdefined-label.d.ts","sourceRoot":"","sources":["../src/schema-converter-userdefined-label.ts"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO7E,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,kFAAkF;AAClF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,GAAG,SAAS,YAC0C,CAAC;AAE3F,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"schema-converter-userdefined-label.d.ts","sourceRoot":"","sources":["../src/schema-converter-userdefined-label.ts"],"names":[],"mappings":"AAcA,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO7E,0FAA0F;AAC1F,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,kFAAkF;AAClF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,GAAG,SAAS,YAC0C,CAAC;AAE3F,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA2BhL"}
|
|
@@ -25,24 +25,25 @@ export function isToken(slot, token) {
|
|
|
25
25
|
export const isUnset = (slot) => slot !== undefined
|
|
26
26
|
&& (isToken(slot, '$') || isToken(slot, '*') || skipStepTrivia(slot, 0) === slot.length);
|
|
27
27
|
/** `converted`, written from `source` between the schemas, with the label carried. */
|
|
28
|
-
export function carryUserDefinedLabel(source, converted, fromSchema, toSchema) {
|
|
28
|
+
export function carryUserDefinedLabel(source, converted, fromSchema, toSchema, maxReferenceId) {
|
|
29
29
|
const up = fromSchema === 'IFC2X3' && ifc4Like(toSchema);
|
|
30
30
|
if (converted === null || (!up && !(toSchema === 'IFC2X3' && ifc4Like(fromSchema))))
|
|
31
31
|
return converted;
|
|
32
32
|
// The head names the type; most records stop here.
|
|
33
33
|
const head = stepRecordHead(converted);
|
|
34
34
|
const type = head ? converted.slice(head.typeStart, head.typeEnd).toUpperCase() : '';
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const layoutType = up && toSchema === 'IFC4X3' && type === 'IFCDISTRIBUTIONBOARD' ? 'IFCELECTRICDISTRIBUTIONBOARD' : type;
|
|
36
|
+
const carry = LABEL_CARRIES.find((c) => layoutType === (up ? c[1] : c[0]));
|
|
37
|
+
const record = carry ? readStepSlots(converted, maxReferenceId) : null;
|
|
37
38
|
if (!carry || !record)
|
|
38
39
|
return converted;
|
|
39
|
-
const [ifc2x3,
|
|
40
|
+
const [ifc2x3, , kind, label] = carry;
|
|
40
41
|
const at = (schema, t, name) => attrNameTable(schema)?.get(t)?.indexOf(name) ?? -1;
|
|
41
42
|
const out = [...record.slots];
|
|
42
43
|
if (up) {
|
|
43
|
-
const ot = at(toSchema,
|
|
44
|
+
const ot = at(toSchema, type, 'ObjectType');
|
|
44
45
|
// `convertRecord` also accepts a record without its ';'.
|
|
45
|
-
const src = (readStepSlots(source) ?? readStepSlots(`${source}
|
|
46
|
+
const src = (readStepSlots(source, maxReferenceId) ?? readStepSlots(`${source};`, maxReferenceId))?.slots;
|
|
46
47
|
const value = src?.[at(fromSchema, ifc2x3, label)];
|
|
47
48
|
if (!src || !isToken(src[at(fromSchema, ifc2x3, kind)], '.USERDEFINED.') || value === undefined || isUnset(value) || !isUnset(out[ot]))
|
|
48
49
|
return converted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-userdefined-label.js","sourceRoot":"","sources":["../src/schema-converter-userdefined-label.ts"],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C,IAAI,GAAG,CAAC,EAAE,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QAClJ,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { CalendarDates } from './schema-calendar-dates.js';
|
|
2
|
+
import type { SourceStore } from './schema-converter-structural-source.js';
|
|
1
3
|
/** Value-form reconciliation for one export: rewrites, and names what it dropped. */
|
|
2
4
|
export declare class ValueForms {
|
|
5
|
+
private readonly timeUnitSources;
|
|
3
6
|
/** Per `TYPE.Attribute`: values dropped, and those that left a required slot `$`. */
|
|
4
7
|
private readonly dropped;
|
|
5
8
|
private readonly emptied;
|
|
9
|
+
private readonly narrowedDates;
|
|
10
|
+
readonly dates: CalendarDates;
|
|
11
|
+
private durationConverted;
|
|
12
|
+
private readonly markDuration;
|
|
13
|
+
constructor(deferDates?: boolean, timeUnitSources?: readonly SourceStore[]);
|
|
6
14
|
/** `line`, already converted from `from` to `to`, with every slot in a form the target accepts. */
|
|
7
|
-
apply(line: string, from: string, to: string): string;
|
|
15
|
+
apply(line: string, from: string, to: string, maxReferenceId?: number): string;
|
|
8
16
|
private count;
|
|
9
17
|
/** One warning per kind, naming every slot a value was dropped from (#10847). */
|
|
10
18
|
warnings(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-value-forms.d.ts","sourceRoot":"","sources":["../src/schema-converter-value-forms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-converter-value-forms.d.ts","sourceRoot":"","sources":["../src/schema-converter-value-forms.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAsI3E,qFAAqF;AACrF,qBAAa,UAAU;IASW,OAAO,CAAC,QAAQ,CAAC,eAAe;IARhE,qFAAqF;IACrF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;IAC3D,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4C;gBAE7D,UAAU,UAAQ,EAAmB,eAAe,GAAE,SAAS,WAAW,EAAO;IAE7F,mGAAmG;IACnG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM;IAgD9E,OAAO,CAAC,KAAK;IAIb,iFAAiF;IACjF,QAAQ,IAAI,MAAM,EAAE;CAerB"}
|