@ifc-lite/export 4.13.3 → 4.14.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/affected-set.d.ts.map +1 -1
- package/dist/affected-set.js +9 -2
- package/dist/affected-set.js.map +1 -1
- package/dist/anonymize-export.js +2 -2
- package/dist/anonymize-export.js.map +1 -1
- package/dist/anonymize-scrub.js +3 -3
- package/dist/anonymize-scrub.js.map +1 -1
- package/dist/appearance-dependencies.js +1 -1
- package/dist/appearance-dependencies.js.map +1 -1
- package/dist/attribute-real-slots.js +1 -1
- package/dist/attribute-real-slots.js.map +1 -1
- package/dist/attribute-slot-types.d.ts.map +1 -1
- package/dist/attribute-slot-types.js +19 -13
- package/dist/attribute-slot-types.js.map +1 -1
- package/dist/authored-resource-cleanup.js +1 -1
- package/dist/authored-resource-cleanup.js.map +1 -1
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +5 -4
- package/dist/declared-property-type.js.map +1 -1
- package/dist/edit-ownership.d.ts +8 -0
- package/dist/edit-ownership.d.ts.map +1 -1
- package/dist/edit-ownership.js +58 -44
- package/dist/edit-ownership.js.map +1 -1
- package/dist/effective-index-created-rows.d.ts +19 -0
- package/dist/effective-index-created-rows.d.ts.map +1 -0
- package/dist/effective-index-created-rows.js +37 -0
- package/dist/effective-index-created-rows.js.map +1 -0
- package/dist/effective-index.d.ts.map +1 -1
- package/dist/effective-index.js +3 -3
- package/dist/effective-index.js.map +1 -1
- package/dist/effective-source-record.js +1 -1
- package/dist/effective-source-record.js.map +1 -1
- package/dist/entity-subgraph.d.ts +6 -2
- package/dist/entity-subgraph.d.ts.map +1 -1
- package/dist/entity-subgraph.js +70 -5
- package/dist/entity-subgraph.js.map +1 -1
- package/dist/entity-type-sets.d.ts +2 -19
- package/dist/entity-type-sets.d.ts.map +1 -1
- package/dist/entity-type-sets.js +14 -4
- package/dist/entity-type-sets.js.map +1 -1
- package/dist/ifc4-registry.d.ts +14 -0
- package/dist/ifc4-registry.d.ts.map +1 -0
- package/dist/ifc4-registry.js +22 -0
- package/dist/ifc4-registry.js.map +1 -0
- package/dist/ifc5-effective-rows.js +1 -1
- package/dist/ifc5-effective-rows.js.map +1 -1
- package/dist/ifc5-tree-scope.js +2 -2
- package/dist/ifc5-tree-scope.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/lod0-generator.d.ts.map +1 -1
- package/dist/lod0-generator.js +14 -8
- package/dist/lod0-generator.js.map +1 -1
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +6 -3
- package/dist/merged-exporter.js.map +1 -1
- package/dist/nonrel-positional-ref-narrowing.js +6 -6
- package/dist/nonrel-positional-ref-narrowing.js.map +1 -1
- package/dist/nonrel-ref-list-types.d.ts +4 -4
- package/dist/nonrel-ref-list-types.d.ts.map +1 -1
- package/dist/nonrel-ref-list-types.js +19 -7
- package/dist/nonrel-ref-list-types.js.map +1 -1
- package/dist/parquet-created-entity-rows.js +1 -1
- package/dist/parquet-created-entity-rows.js.map +1 -1
- package/dist/parquet-relationship-rows.js +1 -1
- package/dist/parquet-relationship-rows.js.map +1 -1
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +2 -2
- package/dist/reference-collector.js.map +1 -1
- package/dist/registry-entity-names.d.ts +6 -2
- package/dist/registry-entity-names.d.ts.map +1 -1
- package/dist/registry-entity-names.js +10 -2
- package/dist/registry-entity-names.js.map +1 -1
- package/dist/relationship-slot-bounds.js +4 -4
- package/dist/relationship-slot-bounds.js.map +1 -1
- package/dist/remesh-context-roots.d.ts +13 -6
- package/dist/remesh-context-roots.d.ts.map +1 -1
- package/dist/remesh-context-roots.js +51 -22
- package/dist/remesh-context-roots.js.map +1 -1
- package/dist/renumber-step-ids.d.ts +43 -0
- package/dist/renumber-step-ids.d.ts.map +1 -0
- package/dist/renumber-step-ids.js +237 -0
- package/dist/renumber-step-ids.js.map +1 -0
- package/dist/retype.d.ts.map +1 -1
- package/dist/retype.js +23 -12
- package/dist/retype.js.map +1 -1
- package/dist/schema-conversion-description.d.ts +6 -0
- package/dist/schema-conversion-description.d.ts.map +1 -0
- package/dist/schema-conversion-description.js +25 -0
- package/dist/schema-conversion-description.js.map +1 -0
- package/dist/schema-conversion-loss-report.d.ts +2 -24
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +34 -0
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-attr-remap.d.ts +8 -0
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +10 -0
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter-enums.d.ts +3 -0
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +4 -1
- package/dist/schema-converter-enums.js.map +1 -1
- package/dist/schema-converter-structural-axes.d.ts +11 -0
- package/dist/schema-converter-structural-axes.d.ts.map +1 -0
- package/dist/schema-converter-structural-axes.js +59 -0
- package/dist/schema-converter-structural-axes.js.map +1 -0
- package/dist/schema-converter-structural-diagnostics.d.ts +24 -0
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -0
- package/dist/schema-converter-structural-diagnostics.js +84 -0
- package/dist/schema-converter-structural-diagnostics.js.map +1 -0
- package/dist/schema-converter-structural-links.d.ts +21 -0
- package/dist/schema-converter-structural-links.d.ts.map +1 -0
- package/dist/schema-converter-structural-links.js +63 -0
- package/dist/schema-converter-structural-links.js.map +1 -0
- package/dist/schema-converter-structural-varying.d.ts +43 -0
- package/dist/schema-converter-structural-varying.d.ts.map +1 -0
- package/dist/schema-converter-structural-varying.js +154 -0
- package/dist/schema-converter-structural-varying.js.map +1 -0
- package/dist/schema-converter-structural.d.ts +8 -0
- package/dist/schema-converter-structural.d.ts.map +1 -0
- package/dist/schema-converter-structural.js +78 -0
- package/dist/schema-converter-structural.js.map +1 -0
- package/dist/schema-converter.d.ts +0 -4
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +19 -32
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-grid-frames.d.ts +19 -0
- package/dist/schema-grid-frames.d.ts.map +1 -0
- package/dist/schema-grid-frames.js +84 -0
- package/dist/schema-grid-frames.js.map +1 -0
- package/dist/schema-ifc2x3-placements.d.ts +12 -0
- package/dist/schema-ifc2x3-placements.d.ts.map +1 -0
- package/dist/schema-ifc2x3-placements.js +297 -0
- package/dist/schema-ifc2x3-placements.js.map +1 -0
- package/dist/schema-ifc2x3-records.d.ts +58 -0
- package/dist/schema-ifc2x3-records.d.ts.map +1 -0
- package/dist/schema-ifc2x3-records.js +179 -0
- package/dist/schema-ifc2x3-records.js.map +1 -0
- package/dist/schema-style-flatten.d.ts +7 -2
- package/dist/schema-style-flatten.d.ts.map +1 -1
- package/dist/schema-style-flatten.js +34 -2
- package/dist/schema-style-flatten.js.map +1 -1
- package/dist/section-export.d.ts.map +1 -1
- package/dist/section-export.js +3 -2
- package/dist/section-export.js.map +1 -1
- package/dist/select-qualification.d.ts.map +1 -1
- package/dist/select-qualification.js +6 -5
- package/dist/select-qualification.js.map +1 -1
- package/dist/step-collection.d.ts.map +1 -1
- package/dist/step-collection.js +3 -0
- package/dist/step-collection.js.map +1 -1
- package/dist/step-derived-quantities.d.ts +23 -0
- package/dist/step-derived-quantities.d.ts.map +1 -0
- package/dist/step-derived-quantities.js +50 -0
- package/dist/step-derived-quantities.js.map +1 -0
- package/dist/step-exporter.js +2 -1
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-header.d.ts.map +1 -1
- package/dist/step-header.js +3 -1
- package/dist/step-header.js.map +1 -1
- package/dist/step-internal-pset-ids.d.ts +7 -0
- package/dist/step-internal-pset-ids.d.ts.map +1 -0
- package/dist/step-internal-pset-ids.js +25 -0
- package/dist/step-internal-pset-ids.js.map +1 -0
- package/dist/step-map-unit-normalization.d.ts.map +1 -1
- package/dist/step-map-unit-normalization.js +10 -3
- package/dist/step-map-unit-normalization.js.map +1 -1
- package/dist/step-native-set-record.d.ts +2 -0
- package/dist/step-native-set-record.d.ts.map +1 -1
- package/dist/step-native-set-record.js +10 -0
- package/dist/step-native-set-record.js.map +1 -1
- package/dist/step-overlay-entities.js +4 -4
- package/dist/step-overlay-entities.js.map +1 -1
- package/dist/step-overlay-property-base.d.ts +13 -0
- package/dist/step-overlay-property-base.d.ts.map +1 -0
- package/dist/step-overlay-property-base.js +30 -0
- package/dist/step-overlay-property-base.js.map +1 -0
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +7 -0
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-property-set-collection.d.ts.map +1 -1
- package/dist/step-property-set-collection.js +7 -2
- package/dist/step-property-set-collection.js.map +1 -1
- package/dist/step-property-set-generators.d.ts.map +1 -1
- package/dist/step-property-set-generators.js +8 -4
- package/dist/step-property-set-generators.js.map +1 -1
- package/dist/step-property-set-index.js +1 -1
- package/dist/step-property-set-index.js.map +1 -1
- package/dist/step-property-set-readers.d.ts.map +1 -1
- package/dist/step-property-set-readers.js +6 -5
- package/dist/step-property-set-readers.js.map +1 -1
- package/dist/step-pset-copy-on-write.d.ts.map +1 -1
- package/dist/step-pset-copy-on-write.js +9 -7
- package/dist/step-pset-copy-on-write.js.map +1 -1
- package/dist/step-serialization.d.ts +1 -1
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +14 -2
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-shared-atom-retention.js +1 -1
- package/dist/step-shared-atom-retention.js.map +1 -1
- package/dist/step-slot-grammar.d.ts +2 -0
- package/dist/step-slot-grammar.d.ts.map +1 -1
- package/dist/step-slot-grammar.js +5 -0
- package/dist/step-slot-grammar.js.map +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +6 -2
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/subset-entity-reader.d.ts.map +1 -1
- package/dist/subset-entity-reader.js +15 -8
- package/dist/subset-entity-reader.js.map +1 -1
- package/dist/subset-roots.d.ts +4 -14
- package/dist/subset-roots.d.ts.map +1 -1
- package/dist/subset-roots.js +14 -4
- package/dist/subset-roots.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A per-TYPE preview of what a schema conversion will do to the entities a
|
|
3
|
-
* store actually contains, computed WITHOUT running the export.
|
|
4
|
-
*
|
|
5
|
-
* `schema-converter.ts`'s `convertStepLine` already makes every one of these
|
|
6
|
-
* decisions per RECORD, but only as a side effect of producing bytes (or, for
|
|
7
|
-
* a non-rooted type with no target representation, throwing —
|
|
8
|
-
* `resolveUnrepresentedEntity`'s documented, intentional behaviour for e.g.
|
|
9
|
-
* `IFCTRIANGULATEDFACESET` into IFC2X3: there is no valid IFC2X3 substitute
|
|
10
|
-
* for a representation item, so guessing one would ship a differently-broken
|
|
11
|
-
* file). Before this module, a caller's only way to learn what a conversion
|
|
12
|
-
* would do — or that it cannot complete at all — was to attempt the full
|
|
13
|
-
* export and either inspect `stats.warnings` after the fact or catch the
|
|
14
|
-
* exception with no indication of what ELSE in the file has the same
|
|
15
|
-
* problem, since the export aborts on the FIRST record it cannot represent.
|
|
16
|
-
*
|
|
17
|
-
* `IfcDataStore.entityIndex.byType` already gives every distinct type
|
|
18
|
-
* present with its express ids, and `classifyEntityTypeConversion`'s
|
|
19
|
-
* decision depends only on the TYPE (the generated attribute tables are
|
|
20
|
-
* positional-name lists, not per-instance data) — so a complete, honest loss
|
|
21
|
-
* report is one pass over the distinct types, not the whole file (#4206: the
|
|
22
|
-
* "the loss report ... names each attribute it could not carry" bar).
|
|
23
|
-
*/
|
|
24
1
|
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
25
2
|
import { type IfcSchemaVersion } from './schema-converter.js';
|
|
26
3
|
/** How one entity TYPE's data survives a schema conversion. */
|
|
@@ -28,7 +5,8 @@ export type EntityConversionKind =
|
|
|
28
5
|
/** Same type, same attribute list: nothing lost. */
|
|
29
6
|
'identity'
|
|
30
7
|
/** Different type name (or the same name, source-schema attrs trimmed/padded),
|
|
31
|
-
* every source attribute has a same-named
|
|
8
|
+
* every source attribute has a same-named or explicitly mapped semantic home
|
|
9
|
+
* in the target. */
|
|
32
10
|
| 'renamed'
|
|
33
11
|
/** Reconciled with SOME loss. Usually at least one source attribute has no
|
|
34
12
|
* home in the target schema's shape for this type (see
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-conversion-loss-report.d.ts","sourceRoot":"","sources":["../src/schema-conversion-loss-report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-conversion-loss-report.d.ts","sourceRoot":"","sources":["../src/schema-conversion-loss-report.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAK/B,+DAA+D;AAC/D,MAAM,MAAM,oBAAoB;AAC9B,oDAAoD;AAClD,UAAU;AACZ;;qBAEqB;GACnB,SAAS;AACX;;;;;;;uEAOuE;GACrE,OAAO;AACT;;mDAEmD;GACjD,SAAS;AACX;;;;wBAIwB;GACtB,SAAS,CAAC;AAEd,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;;mEAG+D;IAC/D,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,oBAAoB,CA8EtB;AAED;sEACsE;AACtE,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;gFAC4E;IAC5E,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACxC;kDAC8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB;mEAC+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB;4EACwE;IACxE,QAAQ,IAAI,MAAM,EAAE,CAAC;CACtB;AAyBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,EACxC,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,oBAAoB,CAqBtB"}
|
|
@@ -1,6 +1,30 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* A per-TYPE preview of what a schema conversion will do to the entities a
|
|
6
|
+
* store actually contains, computed WITHOUT running the export.
|
|
7
|
+
*
|
|
8
|
+
* `schema-converter.ts`'s `convertStepLine` already makes every one of these
|
|
9
|
+
* decisions per RECORD, but only as a side effect of producing bytes (or, for
|
|
10
|
+
* a non-rooted type with no target representation, throwing —
|
|
11
|
+
* `resolveUnrepresentedEntity`'s documented, intentional behaviour for e.g.
|
|
12
|
+
* `IFCTRIANGULATEDFACESET` into IFC2X3: there is no valid IFC2X3 substitute
|
|
13
|
+
* for a representation item, so guessing one would ship a differently-broken
|
|
14
|
+
* file). Before this module, a caller's only way to learn what a conversion
|
|
15
|
+
* would do — or that it cannot complete at all — was to attempt the full
|
|
16
|
+
* export and either inspect `stats.warnings` after the fact or catch the
|
|
17
|
+
* exception with no indication of what ELSE in the file has the same
|
|
18
|
+
* problem, since the export aborts on the FIRST record it cannot represent.
|
|
19
|
+
*
|
|
20
|
+
* `IfcDataStore.entityIndex.byType` already gives every distinct type
|
|
21
|
+
* present with its express ids, and `classifyEntityTypeConversion`'s
|
|
22
|
+
* decision depends only on the TYPE (the generated attribute tables are
|
|
23
|
+
* positional-name lists, not per-instance data) — so a complete, honest loss
|
|
24
|
+
* report is one pass over the distinct types, not the whole file (#4206: the
|
|
25
|
+
* "the loss report ... names each attribute it could not carry" bar).
|
|
26
|
+
*/
|
|
27
|
+
import { isStructuralBoundaryCondition, isStructuralAssignmentConversion } from './schema-converter-structural.js';
|
|
4
28
|
import { convertEntityType, attrNameTable, shouldSkipEntity, } from './schema-converter.js';
|
|
5
29
|
import { BY_NAME_ATTR_REMAP_TYPES } from './schema-converter-attr-remap.js';
|
|
6
30
|
import { isStrictAttrPrefix } from './schema-converter-renames.js';
|
|
@@ -17,6 +41,16 @@ export function classifyEntityTypeConversion(entityType, fromSchema, toSchema) {
|
|
|
17
41
|
return { targetType: upper, kind: 'identity', droppedAttributes: [] };
|
|
18
42
|
const newType = convertEntityType(upper, fromSchema, toSchema);
|
|
19
43
|
const srcAttrs = attrNameTable(fromSchema)?.get(upper);
|
|
44
|
+
// #9668: stiffness fields survive by semantic position and unit, despite
|
|
45
|
+
// renamed Linear/Translational attributes and SELECT wrappers.
|
|
46
|
+
if (isStructuralBoundaryCondition(upper) && ((fromSchema === 'IFC2X3' && toSchema === 'IFC4') || (fromSchema === 'IFC4' && toSchema === 'IFC2X3')))
|
|
47
|
+
// IFC2X3 cannot retain the IFC4 SELECT member: boolean false and a zero
|
|
48
|
+
// measure both become 0, preserving stiffness but losing that distinction.
|
|
49
|
+
return { targetType: upper, kind: fromSchema === 'IFC4' ? 'lossy' : 'renamed', droppedAttributes: [] };
|
|
50
|
+
// #9668: the two linked objects survive in IFC4's analytical assignment,
|
|
51
|
+
// under differently named roles, but their original relationship kind is lost.
|
|
52
|
+
if (isStructuralAssignmentConversion(upper, fromSchema, toSchema))
|
|
53
|
+
return { targetType: newType, kind: 'lossy', droppedAttributes: [] };
|
|
20
54
|
if (shouldSkipEntity(newType, toSchema)) {
|
|
21
55
|
// `productProxy` keeps attributes 1 to 6 (IfcProduct's, OwnerHistory
|
|
22
56
|
// through Representation, #7683) and mints the GlobalId, so what is lost
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-conversion-loss-report.js","sourceRoot":"","sources":["../src/schema-conversion-loss-report.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"schema-conversion-loss-report.js","sourceRoot":"","sources":["../src/schema-conversion-loss-report.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAEnH,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,GAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAwChE;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAkB,EAClB,UAA4B,EAC5B,QAA0B;IAE1B,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,UAAU,KAAK,QAAQ;QAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC;IAEnG,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,QAAQ,GAAG,aAAa,CAAC,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C;QAC5B,oIAAoI;QACpI,KAAK,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAChE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACtC,MAAM,IAAI,GAAG,4BAA4B,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;YAC5E,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;gBAAE,SAAS;YAClE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;QACxG,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAC9D,OAAO;QACL,UAAU;QACV,QAAQ;QACR,OAAO;QACP,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC;QAC3B,WAAW;QACX,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -52,6 +52,14 @@ export declare function splitTopLevelAttributes(attrsRaw: string): string[] | nu
|
|
|
52
52
|
* in `schema-converter.ts`).
|
|
53
53
|
*/
|
|
54
54
|
export declare const BY_NAME_ATTR_REMAP_TYPES: Set<string>;
|
|
55
|
+
/**
|
|
56
|
+
* True for an IfcGridPlacement record still in its source layout on a
|
|
57
|
+
* conversion across IFC4X3 (#9026 item 14). The type keeps its name, but IFC4X3
|
|
58
|
+
* puts the inherited `PlacementRelTo` first, so neither list is a positional
|
|
59
|
+
* prefix of the other and an untouched record has its values in the wrong
|
|
60
|
+
* slots. A record already at the target's arity was lifted by `GridFrames`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function isGridPlacementInSourceLayout(entityType: string, argCount: number, targetCount: number): boolean;
|
|
55
63
|
/**
|
|
56
64
|
* Reconcile a renamed entity's attribute list by matching attribute NAMES
|
|
57
65
|
* between the source and target schema tables, rather than by position.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-attr-remap.d.ts","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAEzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,wBAAwB,aAKnC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,MAAM,GAAG,IAAI,CAQf"}
|
|
1
|
+
{"version":3,"file":"schema-converter-attr-remap.d.ts","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAEzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,wBAAwB,aAKnC,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAEhH;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,MAAM,GAAG,IAAI,CAQf"}
|
|
@@ -63,6 +63,16 @@ export const BY_NAME_ATTR_REMAP_TYPES = new Set([
|
|
|
63
63
|
'IFCSTRUCTURALCURVEACTION',
|
|
64
64
|
'IFCSTRUCTURALSURFACEACTION',
|
|
65
65
|
]);
|
|
66
|
+
/**
|
|
67
|
+
* True for an IfcGridPlacement record still in its source layout on a
|
|
68
|
+
* conversion across IFC4X3 (#9026 item 14). The type keeps its name, but IFC4X3
|
|
69
|
+
* puts the inherited `PlacementRelTo` first, so neither list is a positional
|
|
70
|
+
* prefix of the other and an untouched record has its values in the wrong
|
|
71
|
+
* slots. A record already at the target's arity was lifted by `GridFrames`.
|
|
72
|
+
*/
|
|
73
|
+
export function isGridPlacementInSourceLayout(entityType, argCount, targetCount) {
|
|
74
|
+
return entityType === 'IFCGRIDPLACEMENT' && argCount !== targetCount;
|
|
75
|
+
}
|
|
66
76
|
/**
|
|
67
77
|
* Reconcile a renamed entity's attribute list by matching attribute NAMES
|
|
68
78
|
* between the source and target schema tables, rather than by position.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-attr-remap.js","sourceRoot":"","sources":["../src/schema-converter-attr-remap.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED;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AM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IAC9C,aAAa;IACb,eAAe;IACf,0BAA0B;IAC1B,4BAA4B;CAC7B,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,6BAA6B,CAAC,UAAkB,EAAE,QAAgB,EAAE,WAAmB;IACrG,OAAO,UAAU,KAAK,kBAAkB,IAAI,QAAQ,KAAK,WAAW,CAAC;AACvE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAgB,EAChB,QAA2B,EAC3B,QAA2B;IAE3B,MAAM,MAAM,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
* record whose arity is not the target's is left alone, the same guard the
|
|
15
15
|
* required-slot passes use (position `i` need not be attribute `i`).
|
|
16
16
|
*/
|
|
17
|
+
import { StructuralDiagnostics } from './schema-converter-structural-diagnostics.js';
|
|
17
18
|
import { type SchemaVersionWithRegistry } from '@ifc-lite/parser';
|
|
18
19
|
/** Enum reconciliation for one export: rewrites, and counts what it lost. */
|
|
19
20
|
export declare class EnumReconciliation {
|
|
21
|
+
/** Reuses this per-export collector so both STEP writers forward structural losses. */
|
|
22
|
+
readonly structural: StructuralDiagnostics;
|
|
20
23
|
private readonly losses;
|
|
21
24
|
/** Reconcile `line`, already converted to `toSchema`. */
|
|
22
25
|
apply(line: string, toSchema: SchemaVersionWithRegistry): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-enums.d.ts","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AA2C/F,6EAA6E;AAC7E,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAE/D,yDAAyD;IACzD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,GAAG,MAAM;IAyChE,qEAAqE;IACrE,QAAQ,IAAI,MAAM,EAAE;IAUpB,OAAO,CAAC,MAAM;CAKf"}
|
|
1
|
+
{"version":3,"file":"schema-converter-enums.d.ts","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AA2C/F,6EAA6E;AAC7E,qBAAa,kBAAkB;IAC7B,uFAAuF;IACvF,QAAQ,CAAC,UAAU,wBAA+B;IAClD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAE/D,yDAAyD;IACzD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,yBAAyB,GAAG,MAAM;IAyChE,qEAAqE;IACrE,QAAQ,IAAI,MAAM,EAAE;IAUpB,OAAO,CAAC,MAAM;CAKf"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* record whose arity is not the target's is left alone, the same guard the
|
|
18
18
|
* required-slot passes use (position `i` need not be attribute `i`).
|
|
19
19
|
*/
|
|
20
|
+
import { StructuralDiagnostics } from './schema-converter-structural-diagnostics.js';
|
|
20
21
|
import { getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
21
22
|
import { escapeStepString } from './step-serialization.js';
|
|
22
23
|
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
@@ -50,6 +51,8 @@ const LOSS_TEXT = {
|
|
|
50
51
|
};
|
|
51
52
|
/** Enum reconciliation for one export: rewrites, and counts what it lost. */
|
|
52
53
|
export class EnumReconciliation {
|
|
54
|
+
/** Reuses this per-export collector so both STEP writers forward structural losses. */
|
|
55
|
+
structural = new StructuralDiagnostics();
|
|
53
56
|
losses = new Map();
|
|
54
57
|
/** Reconcile `line`, already converted to `toSchema`. */
|
|
55
58
|
apply(line, toSchema) {
|
|
@@ -106,7 +109,7 @@ export class EnumReconciliation {
|
|
|
106
109
|
const total = [...where.values()].reduce((a, b) => a + b, 0);
|
|
107
110
|
out.push(`${total} enum value(s) the target schema does not define were ${LOSS_TEXT[loss]}: ${[...where.keys()].join(', ')} (#5365).`);
|
|
108
111
|
}
|
|
109
|
-
return out;
|
|
112
|
+
return [...out, ...this.structural.warnings()];
|
|
110
113
|
}
|
|
111
114
|
record(loss, where) {
|
|
112
115
|
const bucket = this.losses.get(loss) ?? new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter-enums.js","sourceRoot":"","sources":["../src/schema-converter-enums.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,2BAA2B,EAAkC,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,wBAAwB,E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C7D,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,yDAAyD,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzI,CAAC;QACD,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAEO,MAAM,CAAC,IAAU,EAAE,KAAa;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,EAAkB,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Matches rust/export/src/schema_structural_axes.rs (#9668). */
|
|
2
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
3
|
+
export declare function listItems(token: string): readonly string[] | null;
|
|
4
|
+
export declare class StructuralAxes {
|
|
5
|
+
private readonly axes;
|
|
6
|
+
private readonly directions;
|
|
7
|
+
note(line: string): void;
|
|
8
|
+
fromStore(store: IfcDataStore): void;
|
|
9
|
+
axis(line: string): string | undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=schema-converter-structural-axes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-axes.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-axes.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAMjE;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoC;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAEhD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAgBxB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAWpC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAUvC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
2
|
+
import { parseStepNumber, skipStepTrivia } from './step-slot-grammar.js';
|
|
3
|
+
import { decodeRange } from './source-ref-bounds.js';
|
|
4
|
+
const ref = (s) => /^#\s*\d+$/.test(s.trim()) ? Number(s.trim().slice(1)) : null;
|
|
5
|
+
export function listItems(token) {
|
|
6
|
+
const start = skipStepTrivia(token, 0);
|
|
7
|
+
if (start < 0 || token[start] !== '(')
|
|
8
|
+
return null;
|
|
9
|
+
// Reuse the shared record frame for a standalone tuple, including trailing
|
|
10
|
+
// comments containing ')'. This parsing envelope is never exported.
|
|
11
|
+
return readStepSlots(`#0=IFCDIRECTION${token};`)?.slots ?? null;
|
|
12
|
+
}
|
|
13
|
+
export class StructuralAxes {
|
|
14
|
+
axes = new Map();
|
|
15
|
+
directions = new Set();
|
|
16
|
+
note(line) {
|
|
17
|
+
const rec = readStepSlots(line), id = /^\s*#(\d+)/.exec(line)?.[1];
|
|
18
|
+
if (!rec || !id)
|
|
19
|
+
return;
|
|
20
|
+
if (rec.type === 'IFCDIRECTION') {
|
|
21
|
+
const values = listItems(rec.slots[0] ?? '')?.map(parseStepNumber);
|
|
22
|
+
if (values?.length === 3 && values.every(Number.isFinite) && values.some(x => x !== 0))
|
|
23
|
+
this.directions.add(Number(id));
|
|
24
|
+
}
|
|
25
|
+
else if (rec.type === 'IFCRELASSOCIATESPROFILEPROPERTIES' && rec.slots.length === 8) {
|
|
26
|
+
const axis = ref(rec.slots[7]);
|
|
27
|
+
for (const token of listItems(rec.slots[4]) ?? []) {
|
|
28
|
+
const member = ref(token);
|
|
29
|
+
if (member === null)
|
|
30
|
+
continue;
|
|
31
|
+
this.axes.set(member, this.axes.has(member) && this.axes.get(member) !== axis ? null : axis);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
fromStore(store) {
|
|
36
|
+
for (const type of ['IFCRELASSOCIATESPROFILEPROPERTIES', 'IFCDIRECTION']) {
|
|
37
|
+
// @raw-entity-enumeration-ok conversion prepass is enabled only for an unedited full-source export
|
|
38
|
+
for (const id of store.entityIndex.byType.get(type) ?? []) {
|
|
39
|
+
// @raw-entity-enumeration-ok same unedited source-only prepass
|
|
40
|
+
const entry = store.entityIndex.byId.get(id);
|
|
41
|
+
if (entry)
|
|
42
|
+
this.note(decodeRange(store.source, entry.byteOffset, entry.byteOffset + entry.byteLength));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
axis(line) {
|
|
47
|
+
if (!/^\s*#\d+\s*=\s*IFCSTRUCTURALCURVEMEMBER(?:VARYING)?\s*\(/i.test(line))
|
|
48
|
+
return undefined;
|
|
49
|
+
const rec = readStepSlots(line), id = /^\s*#(\d+)/.exec(line)?.[1];
|
|
50
|
+
// Profile directions are in the analysis frame. A placed member needs a
|
|
51
|
+
// coordinate transform; angles/defaults/conflicting orientations stay unknown.
|
|
52
|
+
if (!rec || !id || !['IFCSTRUCTURALCURVEMEMBER', 'IFCSTRUCTURALCURVEMEMBERVARYING'].includes(rec.type)
|
|
53
|
+
|| rec.slots.length !== 8 || rec.slots[5].trim() !== '$')
|
|
54
|
+
return undefined;
|
|
55
|
+
const axis = this.axes.get(Number(id));
|
|
56
|
+
return axis != null && this.directions.has(axis) ? `#${axis}` : undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=schema-converter-structural-axes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-axes.js","sourceRoot":"","sources":["../src/schema-converter-structural-axes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAiB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAExG,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACnD,2EAA2E;IAC3E,oEAAoE;IACpE,OAAO,aAAa,CAAC,kBAAkB,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC;AAClE,CAAC;AAED,MAAM,OAAO,cAAc;IACR,IAAI,GAAG,IAAI,GAAG,EAAyB,CAAC;IACxC,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAEhD,IAAI,CAAC,IAAY;QACf,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE;YAAE,OAAO;QACxB,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC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export/src/schema_structural_diagnostics.rs (#9668). */
|
|
2
|
+
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
3
|
+
import { StructuralAxes } from './schema-converter-structural-axes.js';
|
|
4
|
+
import { StructuralLinks } from './schema-converter-structural-links.js';
|
|
5
|
+
import { StructuralVarying } from './schema-converter-structural-varying.js';
|
|
6
|
+
export declare class StructuralDiagnostics {
|
|
7
|
+
readonly axes: StructuralAxes;
|
|
8
|
+
readonly links: StructuralLinks;
|
|
9
|
+
readonly varying: StructuralVarying;
|
|
10
|
+
private readonly losses;
|
|
11
|
+
/** The source prepasses for an IFC2X3 <-> IFC4 export; the caller arms them only for an unedited full export. */
|
|
12
|
+
fromStore(store: IfcDataStore, from: string, to: string): void;
|
|
13
|
+
inspect(line: string, from: string, to: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* A record written as another entity from source-derived facts (`StructuralLinks`,
|
|
16
|
+
* `StructuralVarying`, each armed only for its schema pair): the target record body,
|
|
17
|
+
* reported because the class changes. A body still naming a `withheld` id is
|
|
18
|
+
* refused, and then nothing is reported.
|
|
19
|
+
*/
|
|
20
|
+
rewrite(entity: string, args: readonly string[], withheld: ReadonlySet<number> | undefined): string | undefined;
|
|
21
|
+
private record;
|
|
22
|
+
warnings(): string[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=schema-converter-structural-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-diagnostics.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-diagnostics.ts"],"names":[],"mappings":"AACA,wEAAwE;AACxE,OAAO,EAAuD,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAM7E,qBAAa,qBAAqB;IAChC,QAAQ,CAAC,IAAI,iBAAwB;IACrC,QAAQ,CAAC,KAAK,kBAAyB;IACvC,QAAQ,CAAC,OAAO,oBAA2B;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,iHAAiH;IACjH,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAM9D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAsCrD;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;IAQ/G,OAAO,CAAC,MAAM;IACd,QAAQ,IAAI,MAAM,EAAE;CACrB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/** Matches rust/export/src/schema_structural_diagnostics.rs (#9668). */
|
|
3
|
+
import { getSchemaRegistryForVersion, getCanonicalEntityName } from '@ifc-lite/parser';
|
|
4
|
+
import { convertEntityType } from './schema-converter.js';
|
|
5
|
+
import { destabilizingUnknown, isStructuralAssignmentConversion } from './schema-converter-structural.js';
|
|
6
|
+
import { StructuralAxes } from './schema-converter-structural-axes.js';
|
|
7
|
+
import { StructuralLinks } from './schema-converter-structural-links.js';
|
|
8
|
+
import { StructuralVarying } from './schema-converter-structural-varying.js';
|
|
9
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
10
|
+
import { referencesAnyExpressId } from './step-ref-scan.js';
|
|
11
|
+
const LINK = 'IfcRelAssignsToProduct linking one structural member to its element is written as IfcRelConnectsStructuralElement, the IFC2X3 physical-to-analytical link';
|
|
12
|
+
export class StructuralDiagnostics {
|
|
13
|
+
axes = new StructuralAxes();
|
|
14
|
+
links = new StructuralLinks();
|
|
15
|
+
varying = new StructuralVarying();
|
|
16
|
+
losses = new Map();
|
|
17
|
+
/** The source prepasses for an IFC2X3 <-> IFC4 export; the caller arms them only for an unedited full export. */
|
|
18
|
+
fromStore(store, from, to) {
|
|
19
|
+
if (from === 'IFC2X3')
|
|
20
|
+
this.axes.fromStore(store);
|
|
21
|
+
else
|
|
22
|
+
this.links.fromStore(store);
|
|
23
|
+
this.varying.fromStore(store, from, to);
|
|
24
|
+
}
|
|
25
|
+
inspect(line, from, to) {
|
|
26
|
+
const assignment = /^\s*#\d+\s*=\s*IFCRELCONNECTSSTRUCTURALELEMENT\s*\(/i.test(line) ? readStepSlots(line) : null;
|
|
27
|
+
if (assignment && isStructuralAssignmentConversion(assignment.type, from, to)) {
|
|
28
|
+
this.record('IfcRelConnectsStructuralElement is mapped to IfcRelAssignsToProduct; the relationship kind is not kept in the target file');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!((from === 'IFC2X3' && to === 'IFC4') || (from === 'IFC4' && to === 'IFC2X3')))
|
|
32
|
+
return;
|
|
33
|
+
if (!/^\s*#\d+\s*=\s*(?:IFCSTRUCTURAL|IFCRELCONNECTSSTRUCTURAL|IFCRELASSOCIATESPROFILEPROPERTIES)/i.test(line))
|
|
34
|
+
return;
|
|
35
|
+
const rec = readStepSlots(line);
|
|
36
|
+
if (!rec || !(rec.type.startsWith('IFCSTRUCTURAL') || rec.type.startsWith('IFCRELCONNECTSSTRUCTURAL') || rec.type === 'IFCRELASSOCIATESPROFILEPROPERTIES'))
|
|
37
|
+
return;
|
|
38
|
+
const source = getSchemaRegistryForVersion(from), target = getSchemaRegistryForVersion(to);
|
|
39
|
+
const name = getCanonicalEntityName(source, rec.type);
|
|
40
|
+
if (!name)
|
|
41
|
+
return;
|
|
42
|
+
const targetName = getCanonicalEntityName(target, convertEntityType(rec.type, from, to));
|
|
43
|
+
const src = source.entities[name].allAttributes ?? source.entities[name].attributes;
|
|
44
|
+
const meta = targetName ? target.entities[targetName] : undefined;
|
|
45
|
+
if (!meta) {
|
|
46
|
+
const outcome = to === 'IFC4' ? 'record remains unconverted; output does not conform to IFC4' : 'the original entity semantics cannot be retained';
|
|
47
|
+
this.record(`${rec.type} has no representation in ${to}; ${outcome}`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const tgt = (meta.allAttributes ?? meta.attributes).map(a => a.name);
|
|
51
|
+
src.forEach((attr, i) => {
|
|
52
|
+
// CONST is intrinsic to IFC2X3 linear/planar actions, not lost data.
|
|
53
|
+
if (attr.name === 'PredefinedType' && rec.slots[i]?.trim() === '.CONST.'
|
|
54
|
+
&& ['IFCSTRUCTURALCURVEACTION', 'IFCSTRUCTURALSURFACEACTION', 'IFCSTRUCTURALLINEARACTION', 'IFCSTRUCTURALPLANARACTION'].includes(rec.type))
|
|
55
|
+
return;
|
|
56
|
+
if (attr.name === 'DestabilizingLoad' && rec.slots[i]?.trim() === '$' && to === 'IFC2X3')
|
|
57
|
+
this.record(destabilizingUnknown(rec.type));
|
|
58
|
+
if (!tgt.includes(attr.name) && rec.slots[i] && !['$', '*', ''].includes(rec.slots[i].trim())) {
|
|
59
|
+
const effect = attr.name === 'ConditionCoordinateSystem' ? '; restraint directions in that coordinate system are not preserved' : '';
|
|
60
|
+
this.record(`${rec.type}.${attr.name} has no slot in ${to}; its value is omitted${effect}`);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
// A tangent does not determine the local section z-axis. Do not invent one.
|
|
64
|
+
if (to === 'IFC4' && tgt.includes('Axis') && !src.some(a => a.name === 'Axis') && !this.axes.axis(line))
|
|
65
|
+
this.record(`${rec.type}.Axis is required by IFC4 but unknown; output does not conform until the model's section orientation is resolved`);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A record written as another entity from source-derived facts (`StructuralLinks`,
|
|
69
|
+
* `StructuralVarying`, each armed only for its schema pair): the target record body,
|
|
70
|
+
* reported because the class changes. A body still naming a `withheld` id is
|
|
71
|
+
* refused, and then nothing is reported.
|
|
72
|
+
*/
|
|
73
|
+
rewrite(entity, args, withheld) {
|
|
74
|
+
const attrs = this.links.link(entity, args);
|
|
75
|
+
const rewrite = attrs ? { body: `IFCRELCONNECTSSTRUCTURALELEMENT(${attrs})`, losses: [LINK] } : this.varying.rewrite(entity, args);
|
|
76
|
+
if (!rewrite || (withheld && referencesAnyExpressId(rewrite.body, withheld)))
|
|
77
|
+
return undefined;
|
|
78
|
+
rewrite.losses.forEach((loss) => this.record(loss));
|
|
79
|
+
return rewrite.body;
|
|
80
|
+
}
|
|
81
|
+
record(message) { this.losses.set(message, (this.losses.get(message) ?? 0) + 1); }
|
|
82
|
+
warnings() { return [...this.losses].sort(([a], [b]) => a.localeCompare(b)).map(([message, count]) => `${count} structural conversion record(s): ${message} (#9668).`); }
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=schema-converter-structural-diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-diagnostics.js","sourceRoot":"","sources":["../src/schema-converter-structural-diagnostics.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,wEAAwE;AACxE,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAqB,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,IAAI,GAAG,2JAA2J,CAAC;AAEzK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CAAC,CAAC,CAAC;CACpL"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Matches rust/export/src/schema_structural_links.rs (#9668). */
|
|
2
|
+
import { type IfcDataStore } from '@ifc-lite/parser';
|
|
3
|
+
/**
|
|
4
|
+
* IFC4 -> IFC2X3: the physical-to-analytical link back to its IFC2X3 entity.
|
|
5
|
+
* IFC2X3 links an element to its analytical member with
|
|
6
|
+
* IfcRelConnectsStructuralElement (RelatingElement : IfcElement,
|
|
7
|
+
* RelatedStructuralMember : IfcStructuralMember; IFC2X3_TC1.exp:6613). IFC4 has
|
|
8
|
+
* no such entity, and the upgrade writes the link as IfcRelAssignsToProduct
|
|
9
|
+
* (`structuralAttributes`). This is its inverse, for exactly that shape: one
|
|
10
|
+
* related object that becomes an IFC2X3 IfcStructuralMember, no
|
|
11
|
+
* RelatedObjectsType, and a relating product that becomes an IFC2X3 IfcElement.
|
|
12
|
+
* Anything else stays an IfcRelAssignsToProduct. Types come from the source
|
|
13
|
+
* store, so only an unedited full export arms it.
|
|
14
|
+
*/
|
|
15
|
+
export declare class StructuralLinks {
|
|
16
|
+
private typeOf;
|
|
17
|
+
fromStore(store: IfcDataStore): void;
|
|
18
|
+
/** The IfcRelConnectsStructuralElement attributes for an IFC4 `IFCRELASSIGNSTOPRODUCT` record of that shape. */
|
|
19
|
+
link(entity: string, args: readonly string[]): string | undefined;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=schema-converter-structural-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-links.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-links.ts"],"names":[],"mappings":"AACA,kEAAkE;AAClE,OAAO,EAAuD,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiC1G;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAqD;IAEnE,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAMpC,gHAAgH;IAChH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS;CAOlE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/** Matches rust/export/src/schema_structural_links.rs (#9668). */
|
|
3
|
+
import { getCanonicalEntityName, getSchemaRegistryForVersion } from '@ifc-lite/parser';
|
|
4
|
+
import { convertEntityType } from './schema-converter.js';
|
|
5
|
+
import { listItems } from './schema-converter-structural-axes.js';
|
|
6
|
+
import { skipStepTrivia } from './step-slot-grammar.js';
|
|
7
|
+
/** An entity reference slot, with STEP whitespace and comments around it allowed (#10248). */
|
|
8
|
+
function slotRef(token) {
|
|
9
|
+
const start = skipStepTrivia(token ?? '', 0);
|
|
10
|
+
const m = start < 0 ? null : /^#\s*(\d+)/.exec(token.slice(start));
|
|
11
|
+
return m && skipStepTrivia(token, start + m[0].length) === token.length ? Number(m[1]) : null;
|
|
12
|
+
}
|
|
13
|
+
/** Whether the slot is the unset marker `$`, with STEP whitespace and comments around it allowed (#10248). */
|
|
14
|
+
function slotUnset(token) {
|
|
15
|
+
const start = skipStepTrivia(token, 0);
|
|
16
|
+
return start >= 0 && token[start] === '$' && skipStepTrivia(token, start + 1) === token.length;
|
|
17
|
+
}
|
|
18
|
+
const BECOMES = new Map();
|
|
19
|
+
/** Whether IFC4 `keyword` converts to an IFC2X3 subtype of `parent`, memoized per pair. */
|
|
20
|
+
function becomes(keyword, parent) {
|
|
21
|
+
if (!keyword)
|
|
22
|
+
return false;
|
|
23
|
+
const key = `${keyword} ${parent}`;
|
|
24
|
+
let known = BECOMES.get(key);
|
|
25
|
+
if (known === undefined) {
|
|
26
|
+
const registry = getSchemaRegistryForVersion('IFC2X3');
|
|
27
|
+
const name = getCanonicalEntityName(registry, convertEntityType(keyword, 'IFC4', 'IFC2X3'));
|
|
28
|
+
known = !!name && registry.entities[name]?.inheritanceChain?.includes(parent) === true;
|
|
29
|
+
BECOMES.set(key, known);
|
|
30
|
+
}
|
|
31
|
+
return known;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* IFC4 -> IFC2X3: the physical-to-analytical link back to its IFC2X3 entity.
|
|
35
|
+
* IFC2X3 links an element to its analytical member with
|
|
36
|
+
* IfcRelConnectsStructuralElement (RelatingElement : IfcElement,
|
|
37
|
+
* RelatedStructuralMember : IfcStructuralMember; IFC2X3_TC1.exp:6613). IFC4 has
|
|
38
|
+
* no such entity, and the upgrade writes the link as IfcRelAssignsToProduct
|
|
39
|
+
* (`structuralAttributes`). This is its inverse, for exactly that shape: one
|
|
40
|
+
* related object that becomes an IFC2X3 IfcStructuralMember, no
|
|
41
|
+
* RelatedObjectsType, and a relating product that becomes an IFC2X3 IfcElement.
|
|
42
|
+
* Anything else stays an IfcRelAssignsToProduct. Types come from the source
|
|
43
|
+
* store, so only an unedited full export arms it.
|
|
44
|
+
*/
|
|
45
|
+
export class StructuralLinks {
|
|
46
|
+
typeOf = null;
|
|
47
|
+
fromStore(store) {
|
|
48
|
+
// @raw-entity-enumeration-ok conversion prepass is enabled only for an unedited full-source export
|
|
49
|
+
const byId = store.entityIndex.byId;
|
|
50
|
+
this.typeOf = (id) => byId.get(id)?.type.toUpperCase();
|
|
51
|
+
}
|
|
52
|
+
/** The IfcRelConnectsStructuralElement attributes for an IFC4 `IFCRELASSIGNSTOPRODUCT` record of that shape. */
|
|
53
|
+
link(entity, args) {
|
|
54
|
+
if (!this.typeOf || entity !== 'IFCRELASSIGNSTOPRODUCT' || args.length !== 7 || !slotUnset(args[5]))
|
|
55
|
+
return undefined;
|
|
56
|
+
const related = listItems(args[4]);
|
|
57
|
+
const member = related?.length === 1 ? slotRef(related[0]) : null, element = slotRef(args[6]);
|
|
58
|
+
if (member === null || element === null || !becomes(this.typeOf(member), 'IfcStructuralMember') || !becomes(this.typeOf(element), 'IfcElement'))
|
|
59
|
+
return undefined;
|
|
60
|
+
return `${args.slice(0, 4).join(',')},#${element},#${member}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=schema-converter-structural-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-links.js","sourceRoot":"","sources":["../src/schema-converter-structural-links.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kEAAkE;AAClE,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAqB,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,8FAA8F;AAC9F,SAAS,OAAO,CAAC,KAAyB;IACxC,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,KAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,IAAI,cAAc,CAAC,KAAM,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,KAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClG,CAAC;AAED,8GAA8G;AAC9G,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,C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KAAK,wBAAwB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;QACtH,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9F,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;YAAE,OAAO,SAAS,CAAC;QAClK,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,KAAK,MAAM,EAAE,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Matches rust/export/src/schema_structural_varying.rs (#9668). */
|
|
2
|
+
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
3
|
+
export interface Rewrite {
|
|
4
|
+
readonly body: string;
|
|
5
|
+
readonly losses: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts varying actions in both directions, and only those that convert
|
|
9
|
+
* back: one test (`convertible`) decides both, so a configuration this writes
|
|
10
|
+
* on the way up is one the way down consumes. It reads the source store (the
|
|
11
|
+
* shape aspects, the load types and, on the way down, the configurations) and
|
|
12
|
+
* takes fresh express ids on the way up, so only an unedited full export arms it.
|
|
13
|
+
*/
|
|
14
|
+
export declare class StructuralVarying {
|
|
15
|
+
/** The exporter's express-id allocator, shared with every other record it appends. */
|
|
16
|
+
ids: (() => number) | null;
|
|
17
|
+
private readonly pending;
|
|
18
|
+
private mode;
|
|
19
|
+
private byId;
|
|
20
|
+
/** IFC4 IfcStructuralLoadConfiguration id -> its values. */
|
|
21
|
+
private readonly configs;
|
|
22
|
+
/** IfcProductDefinitionShape id -> the IfcShapeAspects naming it as PartOfProductDefinitionShape. */
|
|
23
|
+
private readonly aspects;
|
|
24
|
+
fromStore(store: IfcDataStore, from: string, to: string): void;
|
|
25
|
+
/** Rust scan_ifc4 keeps configurations referenced by any record that is not converted.
|
|
26
|
+
* They have no IFC2X3 form, so refuse the export instead of silently proxying a referrer.
|
|
27
|
+
*/
|
|
28
|
+
private checkSharedConfigurations;
|
|
29
|
+
private typeOf;
|
|
30
|
+
/** The target record body for a varying action of either schema, or undefined. */
|
|
31
|
+
rewrite(entity: string, args: readonly string[]): Rewrite | undefined;
|
|
32
|
+
/** IfcStructuralLoadConfiguration records written so far, to append after the source records. */
|
|
33
|
+
added(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* The shape aspect locating `loads` when both schemas hold the action: the
|
|
36
|
+
* one aspect of its representation (and `location`, when IFC2X3 names one),
|
|
37
|
+
* enough loads, all of one type that the IFC2X3 WR61 admits.
|
|
38
|
+
*/
|
|
39
|
+
private convertible;
|
|
40
|
+
private toIfc4;
|
|
41
|
+
private toIfc2x3;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=schema-converter-structural-varying.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-varying.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-varying.ts"],"names":[],"mappings":"AACA,oEAAoE;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA8BrD,MAAM,WAAW,OAAO;IAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE;AAGtF;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B,sFAAsF;IACtF,GAAG,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,IAAI,CAAwC;IACpD,OAAO,CAAC,IAAI,CAAkD;IAC9D,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,qGAAqG;IACrG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgE;IAExF,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IA6B9D;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAsBjC,OAAO,CAAC,MAAM;IAEd,kFAAkF;IAClF,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,GAAG,SAAS;IAIrE,iGAAiG;IACjG,KAAK,IAAI,MAAM,EAAE;IAEjB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,QAAQ;CAYjB"}
|