@ifc-lite/export 5.0.0 → 7.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/README.md +42 -20
- 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/anonymize-types.d.ts +2 -0
- package/dist/anonymize-types.d.ts.map +1 -1
- package/dist/declared-property-type.d.ts +2 -110
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +15 -0
- package/dist/declared-property-type.js.map +1 -1
- package/dist/energy-artifact.d.ts +6 -0
- package/dist/energy-artifact.d.ts.map +1 -0
- package/dist/energy-artifact.js +33 -0
- package/dist/energy-artifact.js.map +1 -0
- 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/generated/ifc4-required-slots.d.ts +4 -1
- package/dist/generated/ifc4-required-slots.d.ts.map +1 -1
- package/dist/generated/ifc4-required-slots.js +704 -0
- package/dist/generated/ifc4-required-slots.js.map +1 -1
- package/dist/geometry-diagnostics.d.ts +14 -0
- package/dist/geometry-diagnostics.d.ts.map +1 -0
- package/dist/geometry-diagnostics.js +29 -0
- package/dist/geometry-diagnostics.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/merged-exporter.d.ts +1 -4
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +99 -81
- 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 +7 -0
- package/dist/merged-header.d.ts.map +1 -1
- package/dist/merged-header.js +14 -0
- package/dist/merged-header.js.map +1 -1
- package/dist/merged-inherited-units.d.ts +8 -0
- package/dist/merged-inherited-units.d.ts.map +1 -0
- package/dist/merged-inherited-units.js +117 -0
- package/dist/merged-inherited-units.js.map +1 -0
- package/dist/merged-inverse-claims.d.ts +5 -6
- package/dist/merged-inverse-claims.d.ts.map +1 -1
- package/dist/merged-inverse-claims.js +32 -12
- 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-profile-units.d.ts +9 -0
- package/dist/merged-profile-units.d.ts.map +1 -0
- package/dist/merged-profile-units.js +44 -0
- package/dist/merged-profile-units.js.map +1 -0
- 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/related-entities.d.ts.map +1 -1
- package/dist/related-entities.js +11 -9
- package/dist/related-entities.js.map +1 -1
- package/dist/rust-artifact.d.ts +4 -0
- package/dist/rust-artifact.d.ts.map +1 -0
- package/dist/rust-artifact.js +15 -0
- package/dist/rust-artifact.js.map +1 -0
- package/dist/schema-calendar-date-values.d.ts +16 -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 +26 -0
- package/dist/schema-calendar-dates.d.ts.map +1 -0
- package/dist/schema-calendar-dates.js +226 -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 +26 -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 +98 -76
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-conversion-loss-varying.d.ts +11 -0
- package/dist/schema-conversion-loss-varying.d.ts.map +1 -0
- package/dist/schema-conversion-loss-varying.js +44 -0
- package/dist/schema-conversion-loss-varying.js.map +1 -0
- package/dist/schema-converter-attr-maps.d.ts +18 -5
- package/dist/schema-converter-attr-maps.d.ts.map +1 -1
- package/dist/schema-converter-attr-maps.js +59 -13
- 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 +6 -0
- package/dist/schema-converter-durations.d.ts.map +1 -0
- package/dist/schema-converter-durations.js +42 -0
- package/dist/schema-converter-durations.js.map +1 -0
- package/dist/schema-converter-enums.d.ts +11 -1
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +36 -10
- 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 +10 -5
- package/dist/schema-converter-ifc4-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc4-slots.js +17 -20
- package/dist/schema-converter-ifc4-slots.js.map +1 -1
- package/dist/schema-converter-ifc4x3-upgrade.d.ts +6 -0
- package/dist/schema-converter-ifc4x3-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-ifc4x3-upgrade.js +48 -0
- package/dist/schema-converter-ifc4x3-upgrade.js.map +1 -0
- package/dist/schema-converter-material-referent.d.ts +58 -0
- package/dist/schema-converter-material-referent.d.ts.map +1 -0
- package/dist/schema-converter-material-referent.js +202 -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-space-boundary.d.ts +47 -0
- package/dist/schema-converter-space-boundary.d.ts.map +1 -0
- package/dist/schema-converter-space-boundary.js +108 -0
- package/dist/schema-converter-space-boundary.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 +28 -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 +13 -0
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -1
- package/dist/schema-converter-structural-diagnostics.js +37 -4
- package/dist/schema-converter-structural-diagnostics.js.map +1 -1
- package/dist/schema-converter-structural-source.d.ts +10 -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 +15 -2
- package/dist/schema-converter-structural-varying.d.ts.map +1 -1
- package/dist/schema-converter-structural-varying.js +51 -21
- package/dist/schema-converter-structural-varying.js.map +1 -1
- package/dist/schema-converter-structural.d.ts +3 -0
- package/dist/schema-converter-structural.d.ts.map +1 -1
- package/dist/schema-converter-structural.js +13 -5
- 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 +172 -0
- package/dist/schema-converter-typed-properties.js.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts +31 -0
- package/dist/schema-converter-unrooted-upgrade.d.ts.map +1 -0
- package/dist/schema-converter-unrooted-upgrade.js +278 -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 +32 -1
- package/dist/schema-converter-value-forms.d.ts.map +1 -1
- package/dist/schema-converter-value-forms.js +73 -23
- package/dist/schema-converter-value-forms.js.map +1 -1
- package/dist/schema-converter.d.ts +8 -12
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +61 -58
- 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-project-time-unit.d.ts +8 -0
- package/dist/schema-project-time-unit.d.ts.map +1 -0
- package/dist/schema-project-time-unit.js +123 -0
- package/dist/schema-project-time-unit.js.map +1 -0
- package/dist/schema-structural-varying-constant.d.ts +16 -0
- package/dist/schema-structural-varying-constant.d.ts.map +1 -0
- package/dist/schema-structural-varying-constant.js +36 -0
- package/dist/schema-structural-varying-constant.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 +85 -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 +87 -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/schema-work-control-durations.d.ts +13 -0
- package/dist/schema-work-control-durations.d.ts.map +1 -0
- package/dist/schema-work-control-durations.js +74 -0
- package/dist/schema-work-control-durations.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-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 +6 -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 +12 -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-omission-predicates.d.ts.map +1 -1
- package/dist/step-omission-predicates.js +3 -1
- package/dist/step-omission-predicates.js.map +1 -1
- package/dist/step-outer-args.d.ts +1 -1
- package/dist/step-outer-args.d.ts.map +1 -1
- package/dist/step-outer-args.js +10 -3
- package/dist/step-outer-args.js.map +1 -1
- package/dist/step-overlay-entities.d.ts.map +1 -1
- package/dist/step-overlay-entities.js +9 -0
- 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 +63 -1
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-property-set-readers.d.ts +4 -4
- package/dist/step-property-set-readers.d.ts.map +1 -1
- package/dist/step-property-set-readers.js +13 -13
- package/dist/step-property-set-readers.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-retype-type-link.d.ts +7 -0
- package/dist/step-retype-type-link.d.ts.map +1 -0
- package/dist/step-retype-type-link.js +95 -0
- package/dist/step-retype-type-link.js.map +1 -0
- 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 +12 -6
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/step-subset-relations.d.ts +131 -0
- package/dist/step-subset-relations.d.ts.map +1 -0
- package/dist/step-subset-relations.js +342 -0
- package/dist/step-subset-relations.js.map +1 -0
- package/dist/step-subset-spatial-ancestors.d.ts +26 -0
- package/dist/step-subset-spatial-ancestors.d.ts.map +1 -0
- package/dist/step-subset-spatial-ancestors.js +103 -0
- package/dist/step-subset-spatial-ancestors.js.map +1 -0
- package/dist/step-subset-storey.d.ts +21 -0
- package/dist/step-subset-storey.d.ts.map +1 -0
- package/dist/step-subset-storey.js +319 -0
- package/dist/step-subset-storey.js.map +1 -0
- package/dist/step-subset.d.ts +68 -0
- package/dist/step-subset.d.ts.map +1 -0
- package/dist/step-subset.js +388 -0
- package/dist/step-subset.js.map +1 -0
- package/dist/unit-normalize.d.ts +15 -14
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +118 -91
- package/dist/unit-normalize.js.map +1 -1
- package/dist/xlsx-limits.d.ts +12 -0
- package/dist/xlsx-limits.d.ts.map +1 -0
- package/dist/xlsx-limits.js +48 -0
- package/dist/xlsx-limits.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IfcSchemaVersion } from './schema-converter.js';
|
|
2
|
+
export declare function upgradeNamedType(source: string, from: IfcSchemaVersion, to: IfcSchemaVersion): string | undefined;
|
|
3
|
+
export declare function needsUpgradeSlotMap(source: string, from: IfcSchemaVersion, to: IfcSchemaVersion): boolean;
|
|
4
|
+
export declare function remapUpgradeSlots(type: string, source: readonly string[], target: readonly string[], args: readonly string[]): string;
|
|
5
|
+
export declare function droppedUpgradeSlotNames(type: string, source: readonly string[], target: readonly string[]): string[];
|
|
6
|
+
//# 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":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA0B9D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAKjH;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAGzG;AAMD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAKrI;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAGpH"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
const styleTypes = new Map([
|
|
3
|
+
['IFCDOORSTYLE', 'IFCDOORTYPE'],
|
|
4
|
+
['IFCWINDOWSTYLE', 'IFCWINDOWTYPE'],
|
|
5
|
+
]);
|
|
6
|
+
// IFC4X3 dropped the old case entities. Their supertypes have the same slots.
|
|
7
|
+
// Replacements with a changed layout use a name-based map.
|
|
8
|
+
const renamed = new Map([
|
|
9
|
+
['IFCBEAMSTANDARDCASE', 'IFCBEAM'],
|
|
10
|
+
['IFCBUILDINGELEMENT', 'IFCBUILTELEMENT'],
|
|
11
|
+
['IFCBUILDINGELEMENTTYPE', 'IFCBUILTELEMENTTYPE'],
|
|
12
|
+
['IFCCOLUMNSTANDARDCASE', 'IFCCOLUMN'],
|
|
13
|
+
['IFCDOORSTANDARDCASE', 'IFCDOOR'],
|
|
14
|
+
['IFCMEMBERSTANDARDCASE', 'IFCMEMBER'],
|
|
15
|
+
['IFCOPENINGSTANDARDCASE', 'IFCOPENINGELEMENT'],
|
|
16
|
+
['IFCPLATESTANDARDCASE', 'IFCPLATE'],
|
|
17
|
+
['IFCSLABELEMENTEDCASE', 'IFCSLAB'],
|
|
18
|
+
['IFCSLABSTANDARDCASE', 'IFCSLAB'],
|
|
19
|
+
['IFCWALLELEMENTEDCASE', 'IFCWALL'],
|
|
20
|
+
['IFCWINDOWSTANDARDCASE', 'IFCWINDOW'],
|
|
21
|
+
['IFCELECTRICDISTRIBUTIONPOINT', 'IFCDISTRIBUTIONBOARD'],
|
|
22
|
+
['IFCPROXY', 'IFCBUILDINGELEMENTPROXY'],
|
|
23
|
+
]);
|
|
24
|
+
export function upgradeNamedType(source, from, to) {
|
|
25
|
+
if (to === 'IFC4X3' && (from === 'IFC2X3' || from === 'IFC4')) {
|
|
26
|
+
return renamed.get(source) ?? styleTypes.get(source);
|
|
27
|
+
}
|
|
28
|
+
return from === 'IFC2X3' && to === 'IFC4' ? styleTypes.get(source) : undefined;
|
|
29
|
+
}
|
|
30
|
+
export function needsUpgradeSlotMap(source, from, to) {
|
|
31
|
+
if (to === 'IFC4X3')
|
|
32
|
+
return styleTypes.has(source) || source === 'IFCPROXY';
|
|
33
|
+
return from === 'IFC2X3' && to === 'IFC4' && styleTypes.has(source);
|
|
34
|
+
}
|
|
35
|
+
function sourceName(type, target) {
|
|
36
|
+
return type === 'IFCWINDOWSTYLE' && target === 'PartitioningType' ? 'OperationType' : target;
|
|
37
|
+
}
|
|
38
|
+
export function remapUpgradeSlots(type, source, target, args) {
|
|
39
|
+
// The source operation and proxy type differ from the target PredefinedType.
|
|
40
|
+
return target.map((name) => name === 'PredefinedType'
|
|
41
|
+
? '.NOTDEFINED.'
|
|
42
|
+
: args[source.indexOf(sourceName(type, name))] ?? '$').join(',');
|
|
43
|
+
}
|
|
44
|
+
export function droppedUpgradeSlotNames(type, source, target) {
|
|
45
|
+
const used = new Set(target.map((name) => sourceName(type, name)));
|
|
46
|
+
return source.filter((name) => !used.has(name));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=schema-converter-ifc4x3-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,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type SourceStore } from './schema-converter-structural-source.js';
|
|
2
|
+
export declare const IFC5_MATERIAL_LAYOUT_MISSING = "IFC5 has no EXPRESS attribute registry";
|
|
3
|
+
/** Whether a `from` -> `to` export downgrades IfcMaterialProperties: the one rule the writers and the report share. */
|
|
4
|
+
export declare const downgradesMaterial: (from: string, to: string) => boolean;
|
|
5
|
+
export declare function omitsIfc5MaterialProperties(type: string, from: string, to: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The records the export writes, by id in the line's id space: the effective
|
|
8
|
+
* model in an export (edits, overlay-created records, retypes and deletions
|
|
9
|
+
* applied), a merged model's under its offset, the source in a report.
|
|
10
|
+
*/
|
|
11
|
+
export interface MaterialSource {
|
|
12
|
+
/** The UPPERCASE type of a record the export writes; undefined for one it does not. */
|
|
13
|
+
typeOf(id: number): string | undefined;
|
|
14
|
+
/** Its slots as written; undefined for a record the export does not write or could not read. */
|
|
15
|
+
slots(id: number): readonly string[] | undefined;
|
|
16
|
+
/** 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`. */
|
|
17
|
+
gone?(id: number): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class MaterialReferents {
|
|
20
|
+
private source;
|
|
21
|
+
/** Record id -> why it was not written: the type its `Material` names, or `unreadable` / `no Material` / `an unread record`. */
|
|
22
|
+
private readonly dropped;
|
|
23
|
+
private ifc5Omitted?;
|
|
24
|
+
/** The export's record lookup. Without one nothing resolves, so every downgraded record is left out and reported: never carried unchecked. */
|
|
25
|
+
constructor(source?: MaterialSource);
|
|
26
|
+
/** The merged exporter's next model: its records, in the merge's id space. */
|
|
27
|
+
rearm(source: MaterialSource): void;
|
|
28
|
+
/** 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. */
|
|
29
|
+
resolve(id: number, from: string): number | null;
|
|
30
|
+
/**
|
|
31
|
+
* `line`, a source-schema record before conversion, its IfcMaterialProperties
|
|
32
|
+
* `Material` naming the one IfcMaterial it resolves to; null when none, so the
|
|
33
|
+
* record is not written. Resolved before conversion, so a reference the
|
|
34
|
+
* converter withholds (an IFC4-only set) is replaced first.
|
|
35
|
+
*/
|
|
36
|
+
apply(line: string, from: string, to: string): string | null;
|
|
37
|
+
/** A referent by its material type when it could be read; one that could not is named so, not blamed for its materials. */
|
|
38
|
+
private referentName;
|
|
39
|
+
/** Whether `apply` left record `id` out. */
|
|
40
|
+
leftOut(id: number): boolean;
|
|
41
|
+
warnings(): string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The IfcMaterialProperties records of `store` an IFC4/IFC4X3 -> IFC2X3
|
|
45
|
+
* export leaves out, with their attribute names, for the loss report.
|
|
46
|
+
*/
|
|
47
|
+
export declare function materialPropertiesNotWritten(store: Pick<SourceStore, 'entityIndex'> & Partial<Pick<SourceStore, 'source' | 'deferredEntityIndex'>>, from: string, to: string): {
|
|
48
|
+
ids: number[];
|
|
49
|
+
attributes: readonly string[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Arms `materials` with a merged model's records (#10763) and returns the
|
|
53
|
+
* model's `written` predicate, for the merge loop: its `written` local ids
|
|
54
|
+
* under `offset`, their text remapped as the merge remaps it. Material records
|
|
55
|
+
* are never shared infrastructure, so a merged id is the local id plus the offset.
|
|
56
|
+
*/
|
|
57
|
+
export declare function armMergedModel(materials: MaterialReferents, store: SourceStore, written: (id: number) => boolean, offset: number, sharedRemap: ReadonlyMap<number, number>): (id: number) => boolean;
|
|
58
|
+
//# 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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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,202 @@
|
|
|
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
|
+
export const IFC5_MATERIAL_LAYOUT_MISSING = 'IFC5 has no EXPRESS attribute registry';
|
|
31
|
+
/** A lookup that knows no record. */
|
|
32
|
+
const NOTHING = { typeOf: () => undefined, slots: () => undefined };
|
|
33
|
+
/** Whether a `from` -> `to` export downgrades IfcMaterialProperties: the one rule the writers and the report share. */
|
|
34
|
+
export const downgradesMaterial = (from, to) => to === 'IFC2X3' && (from === 'IFC4' || from === 'IFC4X3');
|
|
35
|
+
export function omitsIfc5MaterialProperties(type, from, to) {
|
|
36
|
+
return type === PROPERTIES && from === 'IFC5' && to === 'IFC2X3';
|
|
37
|
+
}
|
|
38
|
+
export class MaterialReferents {
|
|
39
|
+
source;
|
|
40
|
+
/** Record id -> why it was not written: the type its `Material` names, or `unreadable` / `no Material` / `an unread record`. */
|
|
41
|
+
dropped = new Map();
|
|
42
|
+
ifc5Omitted;
|
|
43
|
+
/** The export's record lookup. Without one nothing resolves, so every downgraded record is left out and reported: never carried unchecked. */
|
|
44
|
+
constructor(source = NOTHING) {
|
|
45
|
+
this.source = source;
|
|
46
|
+
}
|
|
47
|
+
/** The merged exporter's next model: its records, in the merge's id space. */
|
|
48
|
+
rearm(source) {
|
|
49
|
+
this.source = source;
|
|
50
|
+
}
|
|
51
|
+
/** 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. */
|
|
52
|
+
resolve(id, from) {
|
|
53
|
+
const source = this.source, type = source.typeOf(id);
|
|
54
|
+
if (!type)
|
|
55
|
+
return null;
|
|
56
|
+
if (type === 'IFCMATERIAL')
|
|
57
|
+
return source.slots(id) ? id : null;
|
|
58
|
+
const table = attrNameTable(from), names = table?.get(type), slots = source.slots(id);
|
|
59
|
+
if (!names || !slots)
|
|
60
|
+
return null;
|
|
61
|
+
const material = (slot) => {
|
|
62
|
+
const ref = slotRef(slot);
|
|
63
|
+
return ref !== null && source.typeOf(ref) === 'IFCMATERIAL' && source.slots(ref) ? ref : null;
|
|
64
|
+
};
|
|
65
|
+
const own = names.indexOf('Material');
|
|
66
|
+
if (own >= 0)
|
|
67
|
+
return material(slots[own]);
|
|
68
|
+
const at = names.findIndex((n) => MEMBERS.includes(n));
|
|
69
|
+
if (at < 0)
|
|
70
|
+
return null;
|
|
71
|
+
const found = new Set();
|
|
72
|
+
for (const member of listItems(slots[at]) ?? []) {
|
|
73
|
+
const ref = slotRef(member);
|
|
74
|
+
if (ref === null)
|
|
75
|
+
return null;
|
|
76
|
+
const memberType = source.typeOf(ref);
|
|
77
|
+
// Skipped only when the export leaves it out of the list; a missing record names no material, as in Rust.
|
|
78
|
+
if (memberType === undefined) {
|
|
79
|
+
if (source.gone?.(ref))
|
|
80
|
+
continue;
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const memberSlots = source.slots(ref);
|
|
84
|
+
const m = table?.get(memberType)?.indexOf('Material') ?? -1;
|
|
85
|
+
if (m < 0 || !memberSlots)
|
|
86
|
+
return null;
|
|
87
|
+
// A member without a material (an air gap) names none.
|
|
88
|
+
if (slotUnset(memberSlots[m]))
|
|
89
|
+
continue;
|
|
90
|
+
const named = material(memberSlots[m]);
|
|
91
|
+
if (named === null)
|
|
92
|
+
return null;
|
|
93
|
+
found.add(named);
|
|
94
|
+
}
|
|
95
|
+
return found.size === 1 ? [...found][0] : null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* `line`, a source-schema record before conversion, its IfcMaterialProperties
|
|
99
|
+
* `Material` naming the one IfcMaterial it resolves to; null when none, so the
|
|
100
|
+
* record is not written. Resolved before conversion, so a reference the
|
|
101
|
+
* converter withholds (an IFC4-only set) is replaced first.
|
|
102
|
+
*/
|
|
103
|
+
apply(line, from, to) {
|
|
104
|
+
const omitIfc5 = omitsIfc5MaterialProperties(PROPERTIES, from, to);
|
|
105
|
+
const head = omitIfc5 || downgradesMaterial(from, to) ? stepRecordHead(line) : null;
|
|
106
|
+
// A length check first, so most records never build an upper-case copy.
|
|
107
|
+
if (!head || head.typeEnd - head.typeStart !== PROPERTIES.length || line.slice(head.typeStart, head.typeEnd).toUpperCase() !== PROPERTIES)
|
|
108
|
+
return line;
|
|
109
|
+
if (omitIfc5) {
|
|
110
|
+
const id = slotRef(line.slice(0, head.eq));
|
|
111
|
+
if (id !== null)
|
|
112
|
+
(this.ifc5Omitted ??= new Set()).add(id);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const at = attrNameTable(from)?.get(PROPERTIES)?.indexOf('Material') ?? -1;
|
|
116
|
+
if (at < 0)
|
|
117
|
+
return line;
|
|
118
|
+
// Framed as `convertRecord` frames it, which also accepts a record without its ';'.
|
|
119
|
+
// A record that cannot be read is not checked, so it is left out too.
|
|
120
|
+
const frame = stepRecordFrame(line, { allowMissingSemicolon: true });
|
|
121
|
+
const slots = frame ? splitTopLevelStepArguments(frameArgs(line, frame)) : null;
|
|
122
|
+
const named = slotRef(slots?.[at]);
|
|
123
|
+
const material = named === null ? null : this.resolve(named, from);
|
|
124
|
+
if (frame && slots && material !== null) { // `frame && slots` only narrows: unread, no material
|
|
125
|
+
if (material === named)
|
|
126
|
+
return line;
|
|
127
|
+
const out = [...slots];
|
|
128
|
+
out[at] = `#${material}`;
|
|
129
|
+
return withFrameArgs(line, frame, out.join(','));
|
|
130
|
+
}
|
|
131
|
+
// Named as Rust names it: the record unreadable, without a Material, or by its referent.
|
|
132
|
+
const why = !slots ? 'unreadable' : named === null ? 'no Material' : this.referentName(named);
|
|
133
|
+
const id = slotRef(line.slice(0, head.eq)); // past a leading comment, as the head is read
|
|
134
|
+
if (id !== null)
|
|
135
|
+
this.dropped.set(id, why);
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
/** A referent by its material type when it could be read; one that could not is named so, not blamed for its materials. */
|
|
139
|
+
referentName(id) {
|
|
140
|
+
const type = this.source.typeOf(id);
|
|
141
|
+
return type?.startsWith('IFCMATERIAL') && this.source.slots(id) ? type : 'an unread record';
|
|
142
|
+
}
|
|
143
|
+
/** Whether `apply` left record `id` out. */
|
|
144
|
+
leftOut(id) { return this.dropped.has(id) || this.ifc5Omitted?.has(id) === true; }
|
|
145
|
+
warnings() {
|
|
146
|
+
const warnings = [];
|
|
147
|
+
if (this.dropped.size) {
|
|
148
|
+
const sites = [...this.dropped].sort(([a], [b]) => a - b).map(([id, type]) => `#${id} (${type})`);
|
|
149
|
+
warnings.push(`${this.dropped.size} IfcMaterialProperties record(s) were not written: IFC2X3 IfcExtendedMaterialProperties.Material must name one IfcMaterial, and theirs does not: ${sites.join(', ')} (#10763).`);
|
|
150
|
+
}
|
|
151
|
+
if (this.ifc5Omitted) {
|
|
152
|
+
const sites = [...this.ifc5Omitted].sort((a, b) => a - b).map((id) => `#${id}`);
|
|
153
|
+
warnings.push(`${this.ifc5Omitted.size} IfcMaterialProperties record(s) were not written because ${IFC5_MATERIAL_LAYOUT_MISSING}: ${sites.join(', ')} (#11132).`);
|
|
154
|
+
}
|
|
155
|
+
return warnings;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The IfcMaterialProperties records of `store` an IFC4/IFC4X3 -> IFC2X3
|
|
160
|
+
* export leaves out, with their attribute names, for the loss report.
|
|
161
|
+
*/
|
|
162
|
+
export function materialPropertiesNotWritten(store, from, to) {
|
|
163
|
+
const attributes = attrNameTable(from)?.get(PROPERTIES) ?? [];
|
|
164
|
+
// As `apply`: no downgrade, or no Material to check, writes each one.
|
|
165
|
+
if (!downgradesMaterial(from, to) || !attributes.includes('Material'))
|
|
166
|
+
return { ids: [], attributes };
|
|
167
|
+
const { entityIndex, deferredEntityIndex, source: bytes } = store;
|
|
168
|
+
// Without the bytes (none, or a sourceless store's empty buffer) no record can be checked: the report is
|
|
169
|
+
// pessimistic and names each, as a bare `convertStepLine` leaves each out. An export needs the bytes.
|
|
170
|
+
if (!bytes?.byteLength) {
|
|
171
|
+
// @raw-entity-enumeration-ok type-only loss preview without source records
|
|
172
|
+
return { ids: [...new Set(entityIndex.byType.get(PROPERTIES))], attributes };
|
|
173
|
+
}
|
|
174
|
+
// The writer's own decision for the source as parsed: each record through the `apply` the export runs.
|
|
175
|
+
const source = new SourceRecords({ entityIndex, deferredEntityIndex, source: bytes });
|
|
176
|
+
const referents = new MaterialReferents({ typeOf: (id) => source.type(id), slots: (id) => source.slots(id) });
|
|
177
|
+
return { ids: source.ids(PROPERTIES).filter((id) => { const text = source.text(id); return text === undefined || referents.apply(text, from, to) === null; }), attributes };
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Arms `materials` with a merged model's records (#10763) and returns the
|
|
181
|
+
* model's `written` predicate, for the merge loop: its `written` local ids
|
|
182
|
+
* under `offset`, their text remapped as the merge remaps it. Material records
|
|
183
|
+
* are never shared infrastructure, so a merged id is the local id plus the offset.
|
|
184
|
+
*/
|
|
185
|
+
export function armMergedModel(materials, store, written, offset, sharedRemap) {
|
|
186
|
+
const source = new SourceRecords(store);
|
|
187
|
+
const local = (id) => (id > offset && written(id - offset) ? id - offset : null);
|
|
188
|
+
const read = new Map();
|
|
189
|
+
materials.rearm({
|
|
190
|
+
typeOf: (id) => { const l = local(id); return l === null ? undefined : source.type(l); },
|
|
191
|
+
gone: (id) => local(id) === null && id > offset && !!source.type(id - offset)?.startsWith('IFCMATERIAL'),
|
|
192
|
+
slots: (id) => {
|
|
193
|
+
if (!read.has(id)) {
|
|
194
|
+
const l = local(id), text = l === null ? undefined : source.text(l);
|
|
195
|
+
read.set(id, text === undefined ? undefined : readStepSlots(remapEntityText(text, offset, sharedRemap))?.slots);
|
|
196
|
+
}
|
|
197
|
+
return read.get(id);
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
return written;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=schema-converter-material-referent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-material-referent.js","sourceRoot":"","sources":["../src/schema-converter-material-referent.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,aAAa,EAAyB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAC9G,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,kDAAkD;AAClD,MAAM,OAAO,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;AAC/E,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAC3C,MAAM,CAAC,MAAM,4BAA4B,GAAG,wCAAwC,CAAC;AACrF,qCAAqC;AACrC,MAAM,OAAO,GAAmB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG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9D,SAAS,CAAC,KAAK,CAAC;QACd,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxF,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,EAAE,GAAG,MAAM,IAAI,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":3,"file":"schema-converter-owner-history.js","sourceRoot":"","sources":["../src/schema-converter-owner-history.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,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,CA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AAC;QACnC,OAAO;YACL,GAAG,IAAI,CAAC,QAAQ,wEAAwE;gBACxF,0FAA0F;SAC3F,CAAC;IACJ,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,GAAkC,EAClC,OAAgC,EAChC,MAAc;IAEd,MAAM,EAAE,GAAG,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The IFCPROXY an IFC4X3 alignment or positioning product becomes below IFC4X3
|
|
3
|
-
* (`shouldSkipEntity`'s nine types, #7683 EXPORT-MERGE-8). Split out of
|
|
4
|
-
* `schema-converter.ts` to stay under its line budget. Rust twin:
|
|
5
|
-
* `product_proxy` in `rust/export/src/schema_convert.rs`; both are held to
|
|
6
|
-
* `rust/export/tests/fixtures/schema_product_proxy_vectors.json`.
|
|
7
|
-
*
|
|
8
|
-
* Every one of the nine is an IfcProduct subtype, so its first seven
|
|
9
|
-
* attributes are IfcProxy's first seven: GlobalId, OwnerHistory, Name,
|
|
10
|
-
* Description, ObjectType, ObjectPlacement, Representation. The rule:
|
|
11
|
-
* - GlobalId is the MINTED `guid`, never the source's (the federation decision
|
|
12
|
-
* documented at `convertRecord`'s call site and pinned in
|
|
13
|
-
* `merged-exporter.test.ts`);
|
|
14
|
-
* - source attributes 1 to 6 are kept verbatim, so the alignment's curve
|
|
15
|
-
* representation and a referent's placement stay attached;
|
|
16
|
-
* - Name (IfcProxy WR1 requires it) and ObjectType take the quoted source type
|
|
17
|
-
* name when the source slot is `$`,
|
|
18
|
-
* so what the proxy stands for is still readable;
|
|
19
|
-
* - then `.NOTDEFINED.` ProxyType and a `$` Tag. Source attributes past the
|
|
20
|
-
* seventh (the IFC4X3 PredefinedType and friends) have no IfcProxy slot.
|
|
21
|
-
*
|
|
22
|
-
* A missing source slot is written `$`.
|
|
23
|
-
*/
|
|
24
1
|
export declare function productProxy(prefix: string, guid: string, entityType: string, args: readonly string[]): string;
|
|
25
2
|
//# sourceMappingURL=schema-converter-product-proxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-product-proxy.d.ts","sourceRoot":"","sources":["../src/schema-converter-product-proxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-converter-product-proxy.d.ts","sourceRoot":"","sources":["../src/schema-converter-product-proxy.ts"],"names":[],"mappings":"AA6BA,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK9G"}
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
*
|
|
25
25
|
* A missing source slot is written `$`.
|
|
26
26
|
*/
|
|
27
|
+
import { withoutComments } from './step-comment-skip.js';
|
|
27
28
|
export function productProxy(prefix, guid, entityType, args) {
|
|
28
29
|
const slot = (i) => args[i] ?? '$';
|
|
29
30
|
// Name (IfcProxy WR1 requires it) and ObjectType fall back to the quoted source type.
|
|
30
|
-
const orType = (i) => (slot(i)
|
|
31
|
+
const orType = (i) => (withoutComments(slot(i)) === '$' ? `'${entityType}'` : slot(i));
|
|
31
32
|
return `${prefix}IFCPROXY('${guid}',${slot(1)},${orType(2)},${slot(3)},${orType(4)},${slot(5)},${slot(6)},.NOTDEFINED.,$);`;
|
|
32
33
|
}
|
|
33
34
|
//# sourceMappingURL=schema-converter-product-proxy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-product-proxy.js","sourceRoot":"","sources":["../src/schema-converter-product-proxy.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAY,EAAE,UAAkB,EAAE,IAAuB;IACpG,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACnD,sFAAsF;IACtF,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"schema-converter-product-proxy.js","sourceRoot":"","sources":["../src/schema-converter-product-proxy.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,IAAY,EAAE,UAAkB,EAAE,IAAuB;IACpG,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACnD,sFAAsF;IACtF,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACvG,OAAO,GAAG,MAAM,aAAa,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAC9H,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type SourceStore } from './schema-converter-structural-source.js';
|
|
2
|
+
import type { ExportPass } from './step-export-types.js';
|
|
3
|
+
/** Whether a `from` -> `to` export upgrades IfcRelSpaceBoundary to a schema that requires its element. */
|
|
4
|
+
export declare const requiresBoundaryElement: (from: string, to: string) => boolean;
|
|
5
|
+
export declare class SpaceBoundaryElements {
|
|
6
|
+
private readonly dropped;
|
|
7
|
+
private readonly withheldReferrers;
|
|
8
|
+
noteWithheldReferrer(id: number): void;
|
|
9
|
+
pruningSeeds(): Iterable<number>;
|
|
10
|
+
/** Set by `note`: the writer listed what it leaves out up front, and only those are left out. */
|
|
11
|
+
private noted;
|
|
12
|
+
/**
|
|
13
|
+
* `line` unchanged, or null when it is a boundary the upgrade cannot write. After `note`, only a noted boundary
|
|
14
|
+
* is left out: an edited or created one is written as before, so no referrer names a record that is not there.
|
|
15
|
+
*/
|
|
16
|
+
apply(line: string, from: string, to: string): string | null;
|
|
17
|
+
/** Whether `apply` left record `id` out. */
|
|
18
|
+
leftOut(id: number): boolean;
|
|
19
|
+
/** Whether any record is left out: the gate the omitted-reference filter runs behind. */
|
|
20
|
+
get any(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Record `ids` as left out BEFORE the records are converted, so a relationship
|
|
23
|
+
* that precedes a boundary in the file is already scrubbed of it (#11457).
|
|
24
|
+
* `apply` adds the same ids again at conversion, which changes nothing.
|
|
25
|
+
*/
|
|
26
|
+
note(ids: Iterable<number>): void;
|
|
27
|
+
warnings(): string[];
|
|
28
|
+
}
|
|
29
|
+
/** The IfcRelSpaceBoundary records of `store` an IFC2X3 upgrade leaves out, with the attribute that is lost. */
|
|
30
|
+
export declare function spaceBoundariesNotWritten(store: Pick<SourceStore, 'entityIndex'> & Partial<Pick<SourceStore, 'source' | 'deferredEntityIndex'>>, from: string, to: string): number[];
|
|
31
|
+
/** The loss-report entry (none, or one) for the boundaries an IFC2X3 upgrade leaves out: IFC4 requires an element and none is invented. */
|
|
32
|
+
export declare function spaceBoundaryLoss(expressIds: number[]): Array<{
|
|
33
|
+
sourceType: string;
|
|
34
|
+
targetType: string;
|
|
35
|
+
kind: 'lossy';
|
|
36
|
+
droppedAttributes: string[];
|
|
37
|
+
count: number;
|
|
38
|
+
expressIds: number[];
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Note the source boundaries a StepExporter pass leaves out (#11457) before any record is converted, so the
|
|
42
|
+
* relationship filters scrub them from the records that name them. Only an unedited source boundary this pass
|
|
43
|
+
* writes is judged; an edited, retyped or created one, or one that gets a generated property or quantity set, is
|
|
44
|
+
* written as before (`SpaceBoundaryElements.apply`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function noteBoundariesLeftOut(pass: ExportPass, store: Parameters<typeof spaceBoundariesNotWritten>[0]): void;
|
|
47
|
+
//# sourceMappingURL=schema-converter-space-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-space-boundary.d.ts","sourceRoot":"","sources":["../src/schema-converter-space-boundary.ts"],"names":[],"mappings":"AAcA,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAInG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKzD,0GAA0G;AAC1G,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,OACV,CAAC;AAc1D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;IAEvD,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIrC,YAAY,IAAI,QAAQ,CAAC,MAAM,CAAC;IAKjC,iGAAiG;IACjG,OAAO,CAAC,KAAK,CAAS;IAEtB;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAS5D,4CAA4C;IAC5C,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAE5B,yFAAyF;IACzF,IAAI,GAAG,IAAI,OAAO,CAAkC;IAEpD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI;IAEjC,QAAQ,IAAI,MAAM,EAAE;CAKrB;AAED,gHAAgH;AAChH,wBAAgB,yBAAyB,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,MAAM,EAAE,CAOpL;AAED,2IAA2I;AAC3I,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAE1L;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAKpH"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/**
|
|
3
|
+
* An IfcRelSpaceBoundary that names no element, on an IFC2X3 upgrade.
|
|
4
|
+
*
|
|
5
|
+
* IFC2X3 declares `RelatedBuildingElement` OPTIONAL, and a VIRTUAL boundary
|
|
6
|
+
* (a space limit with nothing physical behind it) leaves it `$`. IFC4 and
|
|
7
|
+
* IFC4X3 declare it MANDATORY, and their `CorrectPhysOrVirt` rule wants an
|
|
8
|
+
* IfcVirtualElement (or IfcOpeningElement) behind a VIRTUAL boundary. Neither
|
|
9
|
+
* a `$` nor a demotion to .NOTDEFINED can satisfy that, and the converter
|
|
10
|
+
* invents no entity or reference, so the boundary is not written and the export
|
|
11
|
+
* and the loss report name it. A boundary that names an element is untouched.
|
|
12
|
+
* Twin of Rust `schema_space_boundary.rs`.
|
|
13
|
+
*/
|
|
14
|
+
import { attrNameTable } from './schema-converter.js';
|
|
15
|
+
import { SourceRecords, slotRef } from './schema-converter-structural-source.js';
|
|
16
|
+
import { holdsValue } from './step-comment-skip.js';
|
|
17
|
+
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
18
|
+
import { frameArgs, stepRecordFrame, stepRecordHead } from './step-record-frame.js';
|
|
19
|
+
const BOUNDARY = 'IFCRELSPACEBOUNDARY';
|
|
20
|
+
const ELEMENT = 'RelatedBuildingElement';
|
|
21
|
+
/** Whether a `from` -> `to` export upgrades IfcRelSpaceBoundary to a schema that requires its element. */
|
|
22
|
+
export const requiresBoundaryElement = (from, to) => from === 'IFC2X3' && (to === 'IFC4' || to === 'IFC4X3');
|
|
23
|
+
/** True when `line`, a source-schema record, is an IfcRelSpaceBoundary whose RelatedBuildingElement is unset. A record that cannot be read, or whose arity is not IFC2X3's, is never judged. */
|
|
24
|
+
function unrelated(line, from) {
|
|
25
|
+
const head = stepRecordHead(line);
|
|
26
|
+
// A length check first, so most records never build an upper-case copy.
|
|
27
|
+
if (!head || head.typeEnd - head.typeStart !== BOUNDARY.length || line.slice(head.typeStart, head.typeEnd).toUpperCase() !== BOUNDARY)
|
|
28
|
+
return false;
|
|
29
|
+
const names = attrNameTable(from)?.get(BOUNDARY);
|
|
30
|
+
const at = names?.indexOf(ELEMENT) ?? -1;
|
|
31
|
+
const frame = at < 0 ? null : stepRecordFrame(line, { allowMissingSemicolon: true });
|
|
32
|
+
const slots = frame ? splitTopLevelStepArguments(frameArgs(line, frame)) : null;
|
|
33
|
+
return slots !== null && slots.length === names.length && !holdsValue(slots[at]);
|
|
34
|
+
}
|
|
35
|
+
export class SpaceBoundaryElements {
|
|
36
|
+
dropped = new Set();
|
|
37
|
+
withheldReferrers = new Set();
|
|
38
|
+
noteWithheldReferrer(id) {
|
|
39
|
+
if (this.any)
|
|
40
|
+
this.withheldReferrers.add(id);
|
|
41
|
+
}
|
|
42
|
+
*pruningSeeds() {
|
|
43
|
+
yield* this.dropped;
|
|
44
|
+
yield* this.withheldReferrers;
|
|
45
|
+
}
|
|
46
|
+
/** Set by `note`: the writer listed what it leaves out up front, and only those are left out. */
|
|
47
|
+
noted = false;
|
|
48
|
+
/**
|
|
49
|
+
* `line` unchanged, or null when it is a boundary the upgrade cannot write. After `note`, only a noted boundary
|
|
50
|
+
* is left out: an edited or created one is written as before, so no referrer names a record that is not there.
|
|
51
|
+
*/
|
|
52
|
+
apply(line, from, to) {
|
|
53
|
+
if (!requiresBoundaryElement(from, to) || !unrelated(line, from))
|
|
54
|
+
return line;
|
|
55
|
+
const head = stepRecordHead(line);
|
|
56
|
+
const id = head ? slotRef(line.slice(0, head.eq)) : null;
|
|
57
|
+
if (this.noted && (id === null || !this.dropped.has(id)))
|
|
58
|
+
return line;
|
|
59
|
+
if (id !== null)
|
|
60
|
+
this.dropped.add(id);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
/** Whether `apply` left record `id` out. */
|
|
64
|
+
leftOut(id) { return this.dropped.has(id); }
|
|
65
|
+
/** Whether any record is left out: the gate the omitted-reference filter runs behind. */
|
|
66
|
+
get any() { return this.dropped.size > 0; }
|
|
67
|
+
/**
|
|
68
|
+
* Record `ids` as left out BEFORE the records are converted, so a relationship
|
|
69
|
+
* that precedes a boundary in the file is already scrubbed of it (#11457).
|
|
70
|
+
* `apply` adds the same ids again at conversion, which changes nothing.
|
|
71
|
+
*/
|
|
72
|
+
note(ids) { this.noted = true; for (const id of ids)
|
|
73
|
+
this.dropped.add(id); }
|
|
74
|
+
warnings() {
|
|
75
|
+
if (!this.dropped.size)
|
|
76
|
+
return [];
|
|
77
|
+
const sites = [...this.dropped].sort((a, b) => a - b).map((id) => `#${id}`);
|
|
78
|
+
return [`${this.dropped.size} IfcRelSpaceBoundary record(s) were not written: IFC4 and IFC4X3 require RelatedBuildingElement and the source names none: ${sites.join(', ')}.`];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** The IfcRelSpaceBoundary records of `store` an IFC2X3 upgrade leaves out, with the attribute that is lost. */
|
|
82
|
+
export function spaceBoundariesNotWritten(store, from, to) {
|
|
83
|
+
if (!requiresBoundaryElement(from, to))
|
|
84
|
+
return [];
|
|
85
|
+
const { entityIndex, deferredEntityIndex, source: bytes } = store;
|
|
86
|
+
// Without the bytes nothing can be read, and the export (which needs them) judges each record.
|
|
87
|
+
if (!bytes?.byteLength)
|
|
88
|
+
return [];
|
|
89
|
+
const source = new SourceRecords({ entityIndex, deferredEntityIndex, source: bytes });
|
|
90
|
+
return source.ids(BOUNDARY).filter((id) => { const text = source.text(id); return text !== undefined && unrelated(text, from); });
|
|
91
|
+
}
|
|
92
|
+
/** The loss-report entry (none, or one) for the boundaries an IFC2X3 upgrade leaves out: IFC4 requires an element and none is invented. */
|
|
93
|
+
export function spaceBoundaryLoss(expressIds) {
|
|
94
|
+
return expressIds.length ? [{ sourceType: BOUNDARY, targetType: BOUNDARY, kind: 'lossy', droppedAttributes: [ELEMENT], count: expressIds.length, expressIds }] : [];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Note the source boundaries a StepExporter pass leaves out (#11457) before any record is converted, so the
|
|
98
|
+
* relationship filters scrub them from the records that name them. Only an unedited source boundary this pass
|
|
99
|
+
* writes is judged; an edited, retyped or created one, or one that gets a generated property or quantity set, is
|
|
100
|
+
* written as before (`SpaceBoundaryElements.apply`).
|
|
101
|
+
*/
|
|
102
|
+
export function noteBoundariesLeftOut(pass, store) {
|
|
103
|
+
const hosts = new Set([...pass.newPropertySets, ...pass.newQuantitySets].map((set) => set.entityId));
|
|
104
|
+
pass.enums.boundaries.note(spaceBoundariesNotWritten(store, pass.sourceSchema, pass.schema).filter((id) => !hosts.has(id) &&
|
|
105
|
+
pass.willBeEmitted(id) && !pass.modifiedAttributes.has(id) && !pass.effective.isOverlayCreated(id)
|
|
106
|
+
&& !pass.effective.hasSourceMutation?.(id) && pass.effective.typeOf(id) === BOUNDARY));
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=schema-converter-space-boundary.js.map
|