@ifc-lite/export 2.9.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/csv-cell.d.ts +101 -0
- package/dist/csv-cell.d.ts.map +1 -0
- package/dist/csv-cell.js +90 -0
- package/dist/csv-cell.js.map +1 -0
- package/dist/demesh-session.d.ts.map +1 -1
- package/dist/demesh-session.js +2 -1
- package/dist/demesh-session.js.map +1 -1
- package/dist/effective-index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/lod1-generator.d.ts +0 -2
- package/dist/lod1-generator.d.ts.map +1 -1
- package/dist/lod1-generator.js +1 -1
- package/dist/lod1-generator.js.map +1 -1
- package/dist/merged-exporter.d.ts +3 -2
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +32 -44
- package/dist/merged-exporter.js.map +1 -1
- package/dist/parquet-exporter.js +2 -0
- package/dist/parquet-exporter.js.map +1 -1
- package/dist/reference-collector.d.ts +40 -17
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +89 -19
- package/dist/reference-collector.js.map +1 -1
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +27 -1
- package/dist/schema-converter.js.map +1 -1
- package/dist/source-ref-bounds.d.ts +16 -1
- package/dist/source-ref-bounds.d.ts.map +1 -1
- package/dist/source-ref-bounds.js +85 -0
- package/dist/source-ref-bounds.js.map +1 -1
- package/dist/step-attribute-mutations.d.ts +91 -0
- package/dist/step-attribute-mutations.d.ts.map +1 -0
- package/dist/step-attribute-mutations.js +302 -0
- package/dist/step-attribute-mutations.js.map +1 -0
- package/dist/step-collection.d.ts +55 -0
- package/dist/step-collection.d.ts.map +1 -0
- package/dist/step-collection.js +125 -0
- package/dist/step-collection.js.map +1 -0
- package/dist/step-export-contexts.d.ts +63 -0
- package/dist/step-export-contexts.d.ts.map +1 -0
- package/dist/step-export-contexts.js +51 -0
- package/dist/step-export-contexts.js.map +1 -0
- package/dist/step-export-types.d.ts +262 -0
- package/dist/step-export-types.d.ts.map +1 -0
- package/dist/step-export-types.js +22 -0
- package/dist/step-export-types.js.map +1 -0
- package/dist/step-exporter.d.ts +45 -398
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +145 -2033
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-geometry-types.d.ts +19 -0
- package/dist/step-geometry-types.d.ts.map +1 -0
- package/dist/step-geometry-types.js +57 -0
- package/dist/step-geometry-types.js.map +1 -0
- package/dist/step-georeferencing.d.ts +58 -0
- package/dist/step-georeferencing.d.ts.map +1 -0
- package/dist/step-georeferencing.js +339 -0
- package/dist/step-georeferencing.js.map +1 -0
- package/dist/step-header.d.ts +43 -0
- package/dist/step-header.d.ts.map +1 -0
- package/dist/step-header.js +70 -0
- package/dist/step-header.js.map +1 -0
- package/dist/step-omission-predicates.d.ts +51 -0
- package/dist/step-omission-predicates.d.ts.map +1 -0
- package/dist/step-omission-predicates.js +268 -0
- package/dist/step-omission-predicates.js.map +1 -0
- package/dist/step-overlay-entities.d.ts +64 -0
- package/dist/step-overlay-entities.d.ts.map +1 -0
- package/dist/step-overlay-entities.js +119 -0
- package/dist/step-overlay-entities.js.map +1 -0
- package/dist/step-pass-builder.d.ts +44 -0
- package/dist/step-pass-builder.d.ts.map +1 -0
- package/dist/step-pass-builder.js +249 -0
- package/dist/step-pass-builder.js.map +1 -0
- package/dist/step-property-sets.d.ts +198 -0
- package/dist/step-property-sets.d.ts.map +1 -0
- package/dist/step-property-sets.js +842 -0
- package/dist/step-property-sets.js.map +1 -0
- package/dist/step-serialization.d.ts +16 -1
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +50 -3
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-source-iteration.d.ts +95 -0
- package/dist/step-source-iteration.d.ts.map +1 -0
- package/dist/step-source-iteration.js +178 -0
- package/dist/step-source-iteration.js.map +1 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../src/schema-converter.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-converter.d.ts","sourceRoot":"","sources":["../src/schema-converter.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIxE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AA0JrE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,MAAM,CAQR;AA6HD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,CAmFR;AAsFD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,MAAM,CAqBR"}
|
package/dist/schema-converter.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* and adjusts attribute counts via regex replacement on raw STEP lines.
|
|
20
20
|
*/
|
|
21
21
|
import { generateIfcGuid } from '@ifc-lite/encoding';
|
|
22
|
+
import { deterministicGlobalId } from '@ifc-lite/parser';
|
|
22
23
|
import { ENTITIES_IFC2X3, ENTITIES_IFC4, ENTITIES_IFC4X3 } from '@ifc-lite/data';
|
|
23
24
|
/**
|
|
24
25
|
* Entity type name mappings between schema versions.
|
|
@@ -347,7 +348,32 @@ export function convertStepLine(line, fromSchema, toSchema, random) {
|
|
|
347
348
|
// Replace entities that have no valid representation in the target schema
|
|
348
349
|
// with IFCPROXY placeholders to preserve EXPRESS IDs and prevent dangling references
|
|
349
350
|
if (shouldSkipEntity(newType, toSchema)) {
|
|
350
|
-
|
|
351
|
+
// Derive the placeholder's GlobalId from the source line rather than
|
|
352
|
+
// minting a random one (#2733). Every downgraded entity used to get a
|
|
353
|
+
// FRESH id on every export, so exporting an unchanged IFC4X3 model twice
|
|
354
|
+
// never produced the same bytes: 116 differing lines, 58 of them IFCPROXY,
|
|
355
|
+
// at identical byte size, which is the signature of
|
|
356
|
+
// same-shape-different-identifier.
|
|
357
|
+
//
|
|
358
|
+
// Reusing the SOURCE entity's own GlobalId looks like the obvious fix and
|
|
359
|
+
// is wrong. `merged-exporter.test.ts` pins the case: two federated models
|
|
360
|
+
// legitimately carry the same alignment GlobalId, and a fresh id per
|
|
361
|
+
// occurrence is what stops them being unified into one. Copying the source
|
|
362
|
+
// id would silently collapse two alignments into one.
|
|
363
|
+
//
|
|
364
|
+
// Seeding from the whole line satisfies both. Re-exporting an unchanged
|
|
365
|
+
// model reproduces the line and so the id; two federated occurrences differ
|
|
366
|
+
// because the merged exporter offsets each model's express ids, so their
|
|
367
|
+
// `prefix` differs. Same primitive and same reasoning as `mintUniqueGuid`
|
|
368
|
+
// in merged-exporter.ts, which seeds from the original id plus the model's
|
|
369
|
+
// stable id.
|
|
370
|
+
//
|
|
371
|
+
// A caller-supplied seeded source still wins, so an export that already
|
|
372
|
+
// pins its randomness keeps its existing behaviour.
|
|
373
|
+
const guid = random
|
|
374
|
+
? generateIfcGuid(random)
|
|
375
|
+
: deterministicGlobalId(`ifcproxy:${prefix}${entityType}(${attrsRaw})`);
|
|
376
|
+
return `${prefix}IFCPROXY('${guid}',$,'${entityType}',$,$,$,$,.NOTDEFINED.,$);`;
|
|
351
377
|
}
|
|
352
378
|
// Adjust attribute count if downgrading to IFC2X3
|
|
353
379
|
let finalAttrs = attrsRaw;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-converter.js","sourceRoot":"","sources":["../src/schema-converter.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAIrG;;;;;;GAMG;AAEH,8EAA8E;AAC9E,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,gFAAgF;IAChF,8DAA8D;IAC9D,8CAA8C;IAC9C,CAAC,8BAA8B,EAAE,8BAA8B,CAAC;IAChE,CAAC,oBAAoB,EAAE,eAAe,CAAC;IACvC,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;CACnD,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,CAAC,8BAA8B,EAAE,8BAA8B,CAAC;IAChE,CAAC,eAAe,EAAE,oBAAoB,CAAC;IACvC,6DAA6D;IAC7D,CAAC,YAAY,EAAE,yBAAyB,CAAC;IACzC,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;IAC/C,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;IAC9C,CAAC,sBAAsB,EAAE,yBAAyB,CAAC;IACnD,CAAC,YAAY,EAAE,yBAAyB,CAAC;IACzC,CAAC,mBAAmB,EAAE,YAAY,CAAC;IACnC,CAAC,WAAW,EAAE,yBAAyB,CAAC;IACxC,CAAC,aAAa,EAAE,SAAS,CAAC;IAC1B,CAAC,SAAS,EAAE,y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ACH,MAAM,UAAU,eAAe,CAC7B,UAA4B,EAC5B,QAA0B;IAE1B,OAAO,UAAU,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,UAA4B,EAC5B,QAA0B;IAE1B,IAAI,UAAU,KAAK,QAAQ;QAAE,OAAO,sBAAsB,CAAC;IAE3D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,QAAQ,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;QAClF,QAAQ,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,UAAU,KAAK,QAAQ,IAAI,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC9E,QAAQ,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;IACnG,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,CAAC,cAAc,UAAU,MAAM,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAClE,CAAC,CAAC,cAAc,UAAU,MAAM,QAAQ,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -61,12 +61,27 @@
|
|
|
61
61
|
* over a plain-`Map` index, which can hold one.
|
|
62
62
|
*
|
|
63
63
|
* The readers are therefore gated on this predicate too (`entityLineText` in
|
|
64
|
-
* `step-
|
|
64
|
+
* `step-property-sets.ts`), which also makes them agree with the source-iteration
|
|
65
65
|
* pass: that pass already skips a record whose ref fails this test, so an
|
|
66
66
|
* exempt reader was answering questions about a record the same export had
|
|
67
67
|
* decided not to write.
|
|
68
68
|
*/
|
|
69
|
+
import { type IfcSourceBytes } from '@ifc-lite/parser';
|
|
69
70
|
import type { ExportEntityRef } from './entity-iteration.js';
|
|
71
|
+
/**
|
|
72
|
+
* UTF-8 decode of `[start, end)` of the source, accepting either the raw bytes
|
|
73
|
+
* or the {@link IfcSourceBytes} accessor (#2183). Replaces the direct
|
|
74
|
+
* `safeUtf8Decode(source, …)` calls the exporter used to make: `decodeUtf8` is
|
|
75
|
+
* SAB-safe in exactly the same way, and routing through the accessor is what
|
|
76
|
+
* lets `IfcDataStore.source` change shape without touching those reads.
|
|
77
|
+
*
|
|
78
|
+
* Lives beside {@link createSourceRefReader} because the two are always used
|
|
79
|
+
* together: the predicate decides whether a range may be read, this performs
|
|
80
|
+
* the read. Both `step-exporter.ts` and `step-property-sets.ts` need them, and
|
|
81
|
+
* one decode with one doc comment is what keeps the two files agreeing about
|
|
82
|
+
* what a clamped range means (#2475 step 2b).
|
|
83
|
+
*/
|
|
84
|
+
export declare function decodeRange(src: Uint8Array | IfcSourceBytes, start: number, end: number): string;
|
|
70
85
|
/** The half of a source this module needs: how many bytes it can serve. */
|
|
71
86
|
interface SourceExtent {
|
|
72
87
|
readonly byteLength: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-ref-bounds.d.ts","sourceRoot":"","sources":["../src/source-ref-bounds.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,2EAA2E;AAC3E,UAAU,YAAY;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACtC,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,YAAY,CAAC,GAAG,SAAS,KAAK,OAAO,CAUlF"}
|
|
1
|
+
{"version":3,"file":"source-ref-bounds.d.ts","sourceRoot":"","sources":["../src/source-ref-bounds.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhG;AAED,2EAA2E;AAC3E,UAAU,YAAY;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACtC,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,YAAY,CAAC,GAAG,SAAS,KAAK,OAAO,CAUlF"}
|
|
@@ -1,6 +1,91 @@
|
|
|
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
|
+
* "Can this record's line actually be read out of this source?"
|
|
6
|
+
*
|
|
7
|
+
* The exporter's byte-range gates used to ask two weaker questions — is there a
|
|
8
|
+
* source at all, and does this ref claim a non-empty range — and relied on an
|
|
9
|
+
* UNSTATED invariant to join them: an empty source implies zero-length refs
|
|
10
|
+
* (#2491). Every producer in the repo happens to honour it (the one source-less
|
|
11
|
+
* store builder adds every ref as `(0, 0)`), and nothing states or enforces it.
|
|
12
|
+
*
|
|
13
|
+
* A store that violates it made the exporter write a CORRUPT file, silently. A
|
|
14
|
+
* ref claiming real bytes over a source that has none passed the presence gates,
|
|
15
|
+
* so the property-set generator wrote an `IfcRelDefinesByProperties` naming the
|
|
16
|
+
* host — while the source-iteration pass emitted the host's own line as the
|
|
17
|
+
* EMPTY STRING, because `IfcSourceBytes.decodeUtf8` clamps a range it cannot
|
|
18
|
+
* address. A relationship pointing at a wall whose line had vanished: no error,
|
|
19
|
+
* no warning.
|
|
20
|
+
*
|
|
21
|
+
* ## Why the ref rather than the invariant
|
|
22
|
+
*
|
|
23
|
+
* The invariant could have been asserted where stores are constructed. There is
|
|
24
|
+
* no single chokepoint for that — stores are built by the parser, by the server
|
|
25
|
+
* data model, by test doubles and by any embedder of the published API — so an
|
|
26
|
+
* assertion would have to be added to each, and the next producer (a partial or
|
|
27
|
+
* streaming source, or one that attaches bytes after building its index) would
|
|
28
|
+
* be free to skip it. Testing the ref puts the check where the value is USED,
|
|
29
|
+
* which is one place per read and cannot be bypassed by a new producer.
|
|
30
|
+
*
|
|
31
|
+
* The degraded behaviour is the one the exporter already handles correctly and
|
|
32
|
+
* has tests for: a record with no emittable bytes. Nothing is generated FOR it,
|
|
33
|
+
* nothing that names it is written, and it does not appear in the file — the
|
|
34
|
+
* same outcome as the source-less store the server path builds.
|
|
35
|
+
*
|
|
36
|
+
* ## Why an out-of-range ref is never "no match"
|
|
37
|
+
*
|
|
38
|
+
* This predicate was once exempted from the incidental readers
|
|
39
|
+
* (`getRelatedEntities`, `getPropertySetName`, `getPropertyIdsInSet`, …) on
|
|
40
|
+
* the grounds that "a clamped, empty decode already yields no match, which is
|
|
41
|
+
* the same answer". That is false, and it is false in BOTH directions the
|
|
42
|
+
* range can leave the source. A clamp does not empty a range; it moves an
|
|
43
|
+
* endpoint onto a real file byte, and the window that survives still holds
|
|
44
|
+
* somebody else's record. Measured on a two-record source
|
|
45
|
+
* (`#1=IFCPROPERTYSET(...,(#101,#102));#2=IFCPROPERTYSET(...,(#201,#202));`):
|
|
46
|
+
*
|
|
47
|
+
* - **Negative offset.** `(-2, n)` floors to 0 and decodes from the START OF
|
|
48
|
+
* THE FILE: `getPropertySetName(#2)` answers `'SetA'` — `#1`'s name.
|
|
49
|
+
* - **Overrunning end.** `(0, 9999)` for `#1` clamps to EOF, so the window
|
|
50
|
+
* ends at the file's LAST record. `getPropertySetName(#1)` answers `'SetA'`
|
|
51
|
+
* — right, by luck, because that pattern is unanchored — while
|
|
52
|
+
* `getPropertyIdsInSet(#1)` answers `[201, 202]`, which are `#2`'s members.
|
|
53
|
+
* The readers whose patterns are `$`-anchored match at the end of the
|
|
54
|
+
* CLAMPED window, i.e. against whatever record the file happens to end on.
|
|
55
|
+
*
|
|
56
|
+
* A confidently wrong answer, not "no match". The overrun is also the shape
|
|
57
|
+
* that is REACHABLE — it is the #2491 corrupt-store shape above, a ref
|
|
58
|
+
* claiming bytes the source cannot serve. The negative offset is not, twice
|
|
59
|
+
* over: `OVERLAY_BYTE_OFFSET = -1` (`mutations/src/store-editor.ts`) is the
|
|
60
|
+
* only negative offset in the repo and every site that writes it pairs it
|
|
61
|
+
* with `byteLength: 0`; and `CompactEntityIndex` — the index those readers
|
|
62
|
+
* consult — keeps offsets in a `Uint32Array`, so a negative value cannot
|
|
63
|
+
* round-trip through it at all. The two-record measurements above were taken
|
|
64
|
+
* over a plain-`Map` index, which can hold one.
|
|
65
|
+
*
|
|
66
|
+
* The readers are therefore gated on this predicate too (`entityLineText` in
|
|
67
|
+
* `step-property-sets.ts`), which also makes them agree with the source-iteration
|
|
68
|
+
* pass: that pass already skips a record whose ref fails this test, so an
|
|
69
|
+
* exempt reader was answering questions about a record the same export had
|
|
70
|
+
* decided not to write.
|
|
71
|
+
*/
|
|
72
|
+
import { asSourceBytes } from '@ifc-lite/parser';
|
|
73
|
+
/**
|
|
74
|
+
* UTF-8 decode of `[start, end)` of the source, accepting either the raw bytes
|
|
75
|
+
* or the {@link IfcSourceBytes} accessor (#2183). Replaces the direct
|
|
76
|
+
* `safeUtf8Decode(source, …)` calls the exporter used to make: `decodeUtf8` is
|
|
77
|
+
* SAB-safe in exactly the same way, and routing through the accessor is what
|
|
78
|
+
* lets `IfcDataStore.source` change shape without touching those reads.
|
|
79
|
+
*
|
|
80
|
+
* Lives beside {@link createSourceRefReader} because the two are always used
|
|
81
|
+
* together: the predicate decides whether a range may be read, this performs
|
|
82
|
+
* the read. Both `step-exporter.ts` and `step-property-sets.ts` need them, and
|
|
83
|
+
* one decode with one doc comment is what keeps the two files agreeing about
|
|
84
|
+
* what a clamped range means (#2475 step 2b).
|
|
85
|
+
*/
|
|
86
|
+
export function decodeRange(src, start, end) {
|
|
87
|
+
return asSourceBytes(src).decodeUtf8(start, end);
|
|
88
|
+
}
|
|
4
89
|
/**
|
|
5
90
|
* A predicate over entity refs: true when `[byteOffset, byteOffset+byteLength)`
|
|
6
91
|
* is a non-empty range fully inside `source`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-ref-bounds.js","sourceRoot":"","sources":["../src/source-ref-bounds.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"source-ref-bounds.js","sourceRoot":"","sources":["../src/source-ref-bounds.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAGtE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,GAAgC,EAAE,KAAa,EAAE,GAAW;IACtF,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACnD,CAAC;AAOD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAuC;IAEvC,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,EAAE,EAAE;QACb,IAAI,CAAC,GAAG;YAAE,OAAO,KAAK,CAAC;QACvB,IAAI,GAAG,CAAC,UAAU,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QAC5D,yEAAyE;QACzE,sEAAsE;QACtE,sDAAsD;QACtD,OAAO,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,MAAM,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attribute-mutation serialization cluster StepExporter's private
|
|
3
|
+
* helpers used to be (#2475, remaining private helpers). One pipeline,
|
|
4
|
+
* `applySourceLineMutations`, and the overlay-created sibling that shares its
|
|
5
|
+
* two serialize helpers, `applyOverlayEntityOverrides` — both were already
|
|
6
|
+
* class-bound closures injected into `SourceIterationContext`,
|
|
7
|
+
* `PropertySetContext` and `OverlayEntitiesContext` rather than called
|
|
8
|
+
* directly from `export()`, so moving them out from under `StepExporter`
|
|
9
|
+
* changes nothing any of those three contexts see.
|
|
10
|
+
*
|
|
11
|
+
* `applyAttributeMutations`, `serializeNamedAttribute`,
|
|
12
|
+
* `applyPositionalMutations` and `serializePositionalOverride` are pure —
|
|
13
|
+
* no `this` in their bodies — and have no reader outside this cluster, so
|
|
14
|
+
* they move as ordinary module-private functions. Only
|
|
15
|
+
* `applySourceLineMutations` touched `this`, and only for
|
|
16
|
+
* `this.mutationView`'s two optional methods
|
|
17
|
+
* (`getEntityTypeMutation` / `getPositionalMutationsForEntity`); it now
|
|
18
|
+
* takes the mutation view as its first parameter instead.
|
|
19
|
+
*/
|
|
20
|
+
import type { IfcAttributeValue } from '@ifc-lite/parser';
|
|
21
|
+
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
22
|
+
import type { IfcSchemaVersion } from './schema-converter.js';
|
|
23
|
+
import type { SourceLineMutations } from './step-exporter.js';
|
|
24
|
+
/**
|
|
25
|
+
* THE mutation pipeline for a line read out of the source buffer: retype,
|
|
26
|
+
* then named attribute edits, then positional edits.
|
|
27
|
+
*
|
|
28
|
+
* **One implementation, two call sites**, and that is the whole point. Two
|
|
29
|
+
* passes can write the defining line of a source entity — the
|
|
30
|
+
* source-iteration pass, and the type-object `HasPropertySets` rewrite that
|
|
31
|
+
* REPLACES it (`rewrittenEntityIds` makes the source pass skip those ids).
|
|
32
|
+
* The rewrite used to do its own thing (replace slot 5, nothing else), so
|
|
33
|
+
* every other edit to a type object with a type-owned pset edit was dropped
|
|
34
|
+
* in silence: first the renames (#2462 follow-up), and after those were
|
|
35
|
+
* special-cased here, still the retypes and the positional edits. Whatever
|
|
36
|
+
* the source pass applies, the rewrite has to apply too, or the next edit
|
|
37
|
+
* kind added to one site goes missing at the other.
|
|
38
|
+
*
|
|
39
|
+
* The order is load-bearing:
|
|
40
|
+
*
|
|
41
|
+
* - the retype runs FIRST so named attribute edits resolve against the
|
|
42
|
+
* TARGET class's attribute names, and so positional slots are indexed
|
|
43
|
+
* into the retyped argument list;
|
|
44
|
+
* - the `HasPropertySets` replacement (rewrite path only) runs LAST, on
|
|
45
|
+
* the text this returns. Run it first and a positional edit to slot 5 —
|
|
46
|
+
* or a retype's argument-list rebuild — overwrites the resolved pset
|
|
47
|
+
* list with the stale one, which is the same silent drop one slot over.
|
|
48
|
+
*
|
|
49
|
+
* The expressId is unchanged by all of this, so geometry / placement /
|
|
50
|
+
* representation and every IfcRel* reference (keyed by #id) carry over.
|
|
51
|
+
*
|
|
52
|
+
* All three flags report EFFECT, not intent — each is the answer to "did this
|
|
53
|
+
* operation change the line", measured across that operation alone. The count
|
|
54
|
+
* and the ledger are claims about the FILE, so an edit that resolves to the
|
|
55
|
+
* text already there has delivered nothing and must not be reported: retyping
|
|
56
|
+
* an entity to the class it already is, or writing a positional slot the token
|
|
57
|
+
* it already holds, used to count as a modification and reach the ledger as a
|
|
58
|
+
* landed edit, over a byte-identical line. Discarded edits read the same way:
|
|
59
|
+
* `applyAttributeMutations` drops a name its class has no slot for and
|
|
60
|
+
* `retypeStepLine` returns an unparseable line untouched, and neither is a
|
|
61
|
+
* modification of anything.
|
|
62
|
+
*
|
|
63
|
+
* `retyped` / `positional` matter most in a FULL export, which is where the
|
|
64
|
+
* two are nominated (their edits have no earlier nomination site); named
|
|
65
|
+
* attribute edits are nominated by the collection pass and `attributed` only
|
|
66
|
+
* settles their delivery.
|
|
67
|
+
*/
|
|
68
|
+
export declare function applySourceLineMutations(mutationView: MutablePropertyView | null, expressId: number, entityText: string, recordType: string, attributeMutations: Map<string, string> | undefined, sourceSchema: IfcSchemaVersion, overlayActive: boolean, onRejected?: (attrName: string, value: string) => void): SourceLineMutations;
|
|
69
|
+
/**
|
|
70
|
+
* Apply overlay attribute + positional overrides to an OVERLAY-CREATED
|
|
71
|
+
* entity's argument list (#2006).
|
|
72
|
+
*
|
|
73
|
+
* Distinct from {@link applyAttributeMutations} / {@link applyPositionalMutations},
|
|
74
|
+
* which rewrite a line read out of the source buffer. Here the whole line is
|
|
75
|
+
* ours: it was serialized moments ago from the creation payload, so the
|
|
76
|
+
* argument list is the authoring payload's, not the file's. That difference
|
|
77
|
+
* is why this PADS — `entity_create` takes whatever positional list the
|
|
78
|
+
* caller passes, so a wall authored with three arguments still has a real
|
|
79
|
+
* `Tag` slot at index 7, and dropping the edit because the payload was short
|
|
80
|
+
* would be the very data loss this fixes. The source-buffer path must not
|
|
81
|
+
* pad: there a short line means a different schema, and growing a record we
|
|
82
|
+
* did not author would corrupt it.
|
|
83
|
+
*
|
|
84
|
+
* Named and positional overrides resolve to a slot index up front and share
|
|
85
|
+
* ONE padding rule. Two padding rules on one record is how the next bug
|
|
86
|
+
* starts, and the argument for padding — the class is fixed at creation time,
|
|
87
|
+
* so a short payload is partial authoring — never depended on which of the
|
|
88
|
+
* two APIs queued the edit.
|
|
89
|
+
*/
|
|
90
|
+
export declare function applyOverlayEntityOverrides(argsText: string, entityType: string, attributeOverrides: Map<string, string> | null, positionalOverrides: Map<number, IfcAttributeValue> | null, schemaVersion: IfcSchemaVersion, onRejected?: (attrName: string, value: string) => void): string;
|
|
91
|
+
//# sourceMappingURL=step-attribute-mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-attribute-mutations.d.ts","sourceRoot":"","sources":["../src/step-attribute-mutations.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAiB9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,mBAAmB,GAAG,IAAI,EACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACnD,YAAY,EAAE,gBAAgB,EAC9B,aAAa,EAAE,OAAO,EACtB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACrD,mBAAmB,CAmDrB;AAqHD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC9C,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,IAAI,EAC1D,aAAa,EAAE,gBAAgB,EAC/B,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GACrD,MAAM,CAoER"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { getAttributeNamesAcrossSchemas } from '@ifc-lite/parser';
|
|
5
|
+
import { retypeStepLine } from './retype.js';
|
|
6
|
+
import { splitTopLevelArgs } from './step-argument-parser.js';
|
|
7
|
+
import { getRealTypedSlots, isTypedMarker } from './attribute-real-slots.js';
|
|
8
|
+
import { getEnumTypedSlots, getStringTypedSlots, serializeEnumToken, serializeStringSlot, } from './attribute-slot-types.js';
|
|
9
|
+
import { serializeQualifiedSelectSlot } from './select-qualification.js';
|
|
10
|
+
import { toStepReal, serializeAttributeValue, serializeStepValue, tokenIsRealLiteral, } from './step-serialization.js';
|
|
11
|
+
/**
|
|
12
|
+
* THE mutation pipeline for a line read out of the source buffer: retype,
|
|
13
|
+
* then named attribute edits, then positional edits.
|
|
14
|
+
*
|
|
15
|
+
* **One implementation, two call sites**, and that is the whole point. Two
|
|
16
|
+
* passes can write the defining line of a source entity — the
|
|
17
|
+
* source-iteration pass, and the type-object `HasPropertySets` rewrite that
|
|
18
|
+
* REPLACES it (`rewrittenEntityIds` makes the source pass skip those ids).
|
|
19
|
+
* The rewrite used to do its own thing (replace slot 5, nothing else), so
|
|
20
|
+
* every other edit to a type object with a type-owned pset edit was dropped
|
|
21
|
+
* in silence: first the renames (#2462 follow-up), and after those were
|
|
22
|
+
* special-cased here, still the retypes and the positional edits. Whatever
|
|
23
|
+
* the source pass applies, the rewrite has to apply too, or the next edit
|
|
24
|
+
* kind added to one site goes missing at the other.
|
|
25
|
+
*
|
|
26
|
+
* The order is load-bearing:
|
|
27
|
+
*
|
|
28
|
+
* - the retype runs FIRST so named attribute edits resolve against the
|
|
29
|
+
* TARGET class's attribute names, and so positional slots are indexed
|
|
30
|
+
* into the retyped argument list;
|
|
31
|
+
* - the `HasPropertySets` replacement (rewrite path only) runs LAST, on
|
|
32
|
+
* the text this returns. Run it first and a positional edit to slot 5 —
|
|
33
|
+
* or a retype's argument-list rebuild — overwrites the resolved pset
|
|
34
|
+
* list with the stale one, which is the same silent drop one slot over.
|
|
35
|
+
*
|
|
36
|
+
* The expressId is unchanged by all of this, so geometry / placement /
|
|
37
|
+
* representation and every IfcRel* reference (keyed by #id) carry over.
|
|
38
|
+
*
|
|
39
|
+
* All three flags report EFFECT, not intent — each is the answer to "did this
|
|
40
|
+
* operation change the line", measured across that operation alone. The count
|
|
41
|
+
* and the ledger are claims about the FILE, so an edit that resolves to the
|
|
42
|
+
* text already there has delivered nothing and must not be reported: retyping
|
|
43
|
+
* an entity to the class it already is, or writing a positional slot the token
|
|
44
|
+
* it already holds, used to count as a modification and reach the ledger as a
|
|
45
|
+
* landed edit, over a byte-identical line. Discarded edits read the same way:
|
|
46
|
+
* `applyAttributeMutations` drops a name its class has no slot for and
|
|
47
|
+
* `retypeStepLine` returns an unparseable line untouched, and neither is a
|
|
48
|
+
* modification of anything.
|
|
49
|
+
*
|
|
50
|
+
* `retyped` / `positional` matter most in a FULL export, which is where the
|
|
51
|
+
* two are nominated (their edits have no earlier nomination site); named
|
|
52
|
+
* attribute edits are nominated by the collection pass and `attributed` only
|
|
53
|
+
* settles their delivery.
|
|
54
|
+
*/
|
|
55
|
+
export function applySourceLineMutations(mutationView, expressId, entityText, recordType, attributeMutations, sourceSchema, overlayActive, onRejected) {
|
|
56
|
+
let text = entityText;
|
|
57
|
+
let workingType = recordType.toUpperCase();
|
|
58
|
+
const typeMutation = overlayActive && typeof mutationView.getEntityTypeMutation === 'function'
|
|
59
|
+
? mutationView.getEntityTypeMutation(expressId)
|
|
60
|
+
: null;
|
|
61
|
+
let retyped = false;
|
|
62
|
+
if (typeMutation) {
|
|
63
|
+
const beforeRetype = text;
|
|
64
|
+
text = retypeStepLine(text, recordType, typeMutation.newType, typeMutation.predefinedType ?? null, sourceSchema);
|
|
65
|
+
retyped = text !== beforeRetype;
|
|
66
|
+
// Set even for a no-op retype: the entity IS the target class from here
|
|
67
|
+
// on, so the named and positional edits below must resolve against it.
|
|
68
|
+
workingType = typeMutation.newType.toUpperCase();
|
|
69
|
+
}
|
|
70
|
+
// `applyAttributeMutations` returns its input UNCHANGED when it wrote
|
|
71
|
+
// nothing — no slot resolved for any of the names, or the line does not
|
|
72
|
+
// parse — so comparing is what tells the ledger whether a named attribute
|
|
73
|
+
// edit was really carried, rather than merely attempted.
|
|
74
|
+
let attributed = false;
|
|
75
|
+
if (attributeMutations && attributeMutations.size > 0) {
|
|
76
|
+
const beforeAttributes = text;
|
|
77
|
+
text = applyAttributeMutations(text, workingType, attributeMutations, sourceSchema, onRejected);
|
|
78
|
+
attributed = text !== beforeAttributes;
|
|
79
|
+
}
|
|
80
|
+
const positionals = overlayActive && typeof mutationView.getPositionalMutationsForEntity === 'function'
|
|
81
|
+
? mutationView.getPositionalMutationsForEntity(expressId)
|
|
82
|
+
: null;
|
|
83
|
+
let positional = false;
|
|
84
|
+
if (positionals && positionals.size > 0) {
|
|
85
|
+
const beforePositionals = text;
|
|
86
|
+
text = applyPositionalMutations(text, positionals, workingType, sourceSchema);
|
|
87
|
+
positional = text !== beforePositionals;
|
|
88
|
+
}
|
|
89
|
+
return { text, attributed, retyped, positional };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Rewrite root IFC attributes directly on the original STEP entity line.
|
|
93
|
+
*/
|
|
94
|
+
function applyAttributeMutations(entityText, entityType, attributeMutations, schemaVersion, onRejected) {
|
|
95
|
+
const openParen = entityText.indexOf('(');
|
|
96
|
+
const closeParen = entityText.lastIndexOf(');');
|
|
97
|
+
if (openParen < 0 || closeParen < openParen) {
|
|
98
|
+
return entityText;
|
|
99
|
+
}
|
|
100
|
+
// Cross-schema, not the IFC4 pin: an IFC4X3-only class (IfcCourse, IfcRoad,
|
|
101
|
+
// IfcBridge, …) resolves no slots under the pin, so every named edit on one
|
|
102
|
+
// was silently discarded here too. Identical for the 755 pinned classes
|
|
103
|
+
// that declare attributes — `attribute-slot-types.test.ts` measures that —
|
|
104
|
+
// so no IFC4 export changes; this only stops dropping edits it used to drop.
|
|
105
|
+
const attrNames = getAttributeNamesAcrossSchemas(entityType);
|
|
106
|
+
if (attrNames.length === 0) {
|
|
107
|
+
return entityText;
|
|
108
|
+
}
|
|
109
|
+
const args = splitTopLevelArgs(entityText.slice(openParen + 1, closeParen));
|
|
110
|
+
// A source line NEVER pads (unlike the overlay-created path): a short
|
|
111
|
+
// argument list here means the file speaks a different schema, and growing
|
|
112
|
+
// a record we did not author would corrupt it.
|
|
113
|
+
let changed = false;
|
|
114
|
+
const realSlots = getRealTypedSlots(entityType, schemaVersion);
|
|
115
|
+
for (const [attrName, value] of attributeMutations) {
|
|
116
|
+
const index = attrNames.indexOf(attrName);
|
|
117
|
+
if (index < 0 || index >= args.length)
|
|
118
|
+
continue;
|
|
119
|
+
// The source path shares every `$`-slot hole with the overlay-created
|
|
120
|
+
// path, because a source record has plenty of `$` slots of its own. Both
|
|
121
|
+
// go through the one helper below.
|
|
122
|
+
const serialized = serializeNamedAttribute(entityType, index, value, args[index], realSlots);
|
|
123
|
+
if (serialized === null) {
|
|
124
|
+
// Slot untouched AND reported. Not counted as a change: claiming a
|
|
125
|
+
// modification we did not make is the failure this avoids.
|
|
126
|
+
onRejected?.(attrName, value);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
args[index] = serialized;
|
|
130
|
+
changed = true;
|
|
131
|
+
}
|
|
132
|
+
if (!changed) {
|
|
133
|
+
return entityText;
|
|
134
|
+
}
|
|
135
|
+
return `${entityText.slice(0, openParen + 1)}${args.join(',')}${entityText.slice(closeParen)}`;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Serialize one NAMED attribute override into its slot — the single point
|
|
139
|
+
* both the source-buffer rewrite and the overlay-created rewrite go through.
|
|
140
|
+
*
|
|
141
|
+
* `serializeAttributeValue` decides the STEP form by reading the token being
|
|
142
|
+
* replaced, which is sound only while that token carries type information. A
|
|
143
|
+
* `$` slot carries none, and both paths have plenty: a source record's
|
|
144
|
+
* optional attributes are `$`, and overlay-created records pad missing slots
|
|
145
|
+
* with `$`. So the declared type decides first, and inference is the fallback
|
|
146
|
+
* for slots the schema does not classify (references, SELECTs, numerics),
|
|
147
|
+
* where reading the old token is exactly the right heuristic.
|
|
148
|
+
*
|
|
149
|
+
* Before this REAL check existed, "the declared type decides first" was true
|
|
150
|
+
* for enum/string slots only — a REAL-backed slot (`IfcMapConversion.
|
|
151
|
+
* OrthogonalHeight`, any other `IfcLengthMeasure`/`IfcReal`-typed attribute)
|
|
152
|
+
* fell straight to `serializeAttributeValue`'s token inference, which quotes
|
|
153
|
+
* anything it cannot recognize as numeric. A schema-legal `$` placeholder
|
|
154
|
+
* carries no digits to recognize, so setting such a field for the first time
|
|
155
|
+
* wrote `'12345'` in a slot ISO 10303-21 requires to be an unquoted REAL —
|
|
156
|
+
* silently invalid output (#2724, LTplus-AG/ifc-lite#2475).
|
|
157
|
+
*/
|
|
158
|
+
function serializeNamedAttribute(entityType, index, value, currentToken, realSlots) {
|
|
159
|
+
if (getEnumTypedSlots(entityType).has(index))
|
|
160
|
+
return serializeEnumToken(value);
|
|
161
|
+
if (getStringTypedSlots(entityType).has(index))
|
|
162
|
+
return serializeStringSlot(value);
|
|
163
|
+
if (realSlots.has(index)) {
|
|
164
|
+
const trimmed = value.trim();
|
|
165
|
+
if (trimmed === '')
|
|
166
|
+
return '$';
|
|
167
|
+
const numberValue = Number(trimmed);
|
|
168
|
+
if (Number.isFinite(numberValue))
|
|
169
|
+
return toStepReal(numberValue);
|
|
170
|
+
// A non-numeric value in a REAL slot used to fall through and be QUOTED,
|
|
171
|
+
// producing the same ISO 10303-21 violation #2725 exists to prevent
|
|
172
|
+
// (#2741). `StoreEditor.setAttribute` takes a string, so any UI text
|
|
173
|
+
// field bound to a georeferencing REAL can deliver one; it does not need
|
|
174
|
+
// a corrupt file.
|
|
175
|
+
//
|
|
176
|
+
// `null` means "leave the slot as the file had it". Simply returning
|
|
177
|
+
// `currentToken` here would stop the invalid output but SILENTLY DISCARD
|
|
178
|
+
// the edit - the exporter would then claim a modification it did not
|
|
179
|
+
// carry, which is the exact misreport #2723/#2724/#2726 were written to
|
|
180
|
+
// pin. The caller turns this into a warning, so a dropped edit is visible
|
|
181
|
+
// rather than inferred from absence.
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
return serializeAttributeValue(value, currentToken);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Apply overlay attribute + positional overrides to an OVERLAY-CREATED
|
|
188
|
+
* entity's argument list (#2006).
|
|
189
|
+
*
|
|
190
|
+
* Distinct from {@link applyAttributeMutations} / {@link applyPositionalMutations},
|
|
191
|
+
* which rewrite a line read out of the source buffer. Here the whole line is
|
|
192
|
+
* ours: it was serialized moments ago from the creation payload, so the
|
|
193
|
+
* argument list is the authoring payload's, not the file's. That difference
|
|
194
|
+
* is why this PADS — `entity_create` takes whatever positional list the
|
|
195
|
+
* caller passes, so a wall authored with three arguments still has a real
|
|
196
|
+
* `Tag` slot at index 7, and dropping the edit because the payload was short
|
|
197
|
+
* would be the very data loss this fixes. The source-buffer path must not
|
|
198
|
+
* pad: there a short line means a different schema, and growing a record we
|
|
199
|
+
* did not author would corrupt it.
|
|
200
|
+
*
|
|
201
|
+
* Named and positional overrides resolve to a slot index up front and share
|
|
202
|
+
* ONE padding rule. Two padding rules on one record is how the next bug
|
|
203
|
+
* starts, and the argument for padding — the class is fixed at creation time,
|
|
204
|
+
* so a short payload is partial authoring — never depended on which of the
|
|
205
|
+
* two APIs queued the edit.
|
|
206
|
+
*/
|
|
207
|
+
export function applyOverlayEntityOverrides(argsText, entityType, attributeOverrides, positionalOverrides, schemaVersion, onRejected) {
|
|
208
|
+
const args = argsText.length > 0 ? splitTopLevelArgs(argsText) : [];
|
|
209
|
+
const attrNames = getAttributeNamesAcrossSchemas(entityType);
|
|
210
|
+
const named = [];
|
|
211
|
+
for (const [attrName, value] of attributeOverrides ?? []) {
|
|
212
|
+
const index = attrNames.indexOf(attrName);
|
|
213
|
+
if (index >= 0)
|
|
214
|
+
named.push([index, value]);
|
|
215
|
+
}
|
|
216
|
+
// Grow to the class's FULL declared arity as soon as any override names a
|
|
217
|
+
// declared slot the creation payload never reached. Growing only as far as
|
|
218
|
+
// the edited slot would emit eight arguments for an IfcWall that declares
|
|
219
|
+
// nine: this parser tolerates the truncated record, a schema-validating
|
|
220
|
+
// consumer rejects the file.
|
|
221
|
+
//
|
|
222
|
+
// An index PAST the declared layout is not a slot at all, so it cannot
|
|
223
|
+
// justify growing the record and stays dropped — as does any override on a
|
|
224
|
+
// class neither schema source knows, where there is no arity to grow to.
|
|
225
|
+
let needsPad = named.some(([index]) => index >= args.length);
|
|
226
|
+
if (!needsPad && positionalOverrides) {
|
|
227
|
+
for (const [index] of positionalOverrides) {
|
|
228
|
+
if (index >= args.length && index < attrNames.length) {
|
|
229
|
+
needsPad = true;
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (needsPad) {
|
|
235
|
+
while (args.length < attrNames.length)
|
|
236
|
+
args.push('$');
|
|
237
|
+
}
|
|
238
|
+
// Every `named` index is < attrNames.length by construction, and padding
|
|
239
|
+
// has taken args.length to at least that, so each one lands.
|
|
240
|
+
const realSlots = getRealTypedSlots(entityType, schemaVersion);
|
|
241
|
+
for (const [index, value] of named) {
|
|
242
|
+
const serialized = serializeNamedAttribute(entityType, index, value, args[index], realSlots);
|
|
243
|
+
// Overlay-created entities take the same rejection: a non-numeric REAL is
|
|
244
|
+
// invalid STEP whoever authored the record. The slot keeps the `$` this
|
|
245
|
+
// path padded it with, rather than gaining a quoted string.
|
|
246
|
+
if (serialized === null) {
|
|
247
|
+
onRejected?.(attrNames[index] ?? `#${index}`, value);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
args[index] = serialized;
|
|
251
|
+
}
|
|
252
|
+
if (positionalOverrides && positionalOverrides.size > 0) {
|
|
253
|
+
for (const [index, value] of positionalOverrides) {
|
|
254
|
+
if (index < 0 || index >= args.length)
|
|
255
|
+
continue;
|
|
256
|
+
args[index] = serializePositionalOverride(entityType, index, value, args[index], realSlots, schemaVersion);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return args.join(',');
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Apply positional STEP argument overrides to an entity line.
|
|
263
|
+
* Used for non-IfcRoot edits (e.g. profile dimensions) where attributes
|
|
264
|
+
* have no symbolic names. Indexes that fall outside the existing arg list
|
|
265
|
+
* are silently ignored.
|
|
266
|
+
*/
|
|
267
|
+
function applyPositionalMutations(entityText, positionals, entityType, schemaVersion) {
|
|
268
|
+
const openParen = entityText.indexOf('(');
|
|
269
|
+
const closeParen = entityText.lastIndexOf(');');
|
|
270
|
+
if (openParen < 0 || closeParen < openParen)
|
|
271
|
+
return entityText;
|
|
272
|
+
const args = splitTopLevelArgs(entityText.slice(openParen + 1, closeParen));
|
|
273
|
+
const realSlots = getRealTypedSlots(entityType, schemaVersion);
|
|
274
|
+
let changed = false;
|
|
275
|
+
for (const [index, value] of positionals) {
|
|
276
|
+
if (index < 0 || index >= args.length)
|
|
277
|
+
continue;
|
|
278
|
+
args[index] = serializePositionalOverride(entityType, index, value, args[index], realSlots, schemaVersion);
|
|
279
|
+
changed = true;
|
|
280
|
+
}
|
|
281
|
+
if (!changed)
|
|
282
|
+
return entityText;
|
|
283
|
+
return `${entityText.slice(0, openParen + 1)}${args.join(',')}${entityText.slice(closeParen)}`;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Serialize one positional override, composing the schema-aware passes:
|
|
287
|
+
* explicit `{ real }`/`{ typed }` marker → SELECT auto-qualification
|
|
288
|
+
* (`IFCBOOLEAN(.T.)`) → REAL forcing. For REAL forcing the current source
|
|
289
|
+
* token is a secondary signal: replacing a value that was already a REAL
|
|
290
|
+
* (`0.4`, `1.5E-7`) keeps it REAL even for entities the XSD index doesn't
|
|
291
|
+
* cover, so a whole-number edit can't silently downgrade the slot.
|
|
292
|
+
*/
|
|
293
|
+
function serializePositionalOverride(entityType, index, value, currentToken, realSlots, schemaVersion) {
|
|
294
|
+
if (isTypedMarker(value))
|
|
295
|
+
return serializeStepValue(value);
|
|
296
|
+
const qualified = serializeQualifiedSelectSlot(entityType, index, value);
|
|
297
|
+
if (qualified !== null)
|
|
298
|
+
return qualified;
|
|
299
|
+
const forceReal = realSlots.has(index) || tokenIsRealLiteral(currentToken);
|
|
300
|
+
return serializeStepValue(value, forceReal);
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=step-attribute-mutations.js.map
|