@ifc-lite/export 2.9.4 → 3.0.1
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/declared-property-type.d.ts +19 -8
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +31 -9
- package/dist/declared-property-type.js.map +1 -1
- 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 +19 -0
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +23 -41
- package/dist/merged-exporter.js.map +1 -1
- package/dist/parquet-exporter.d.ts +1 -3
- package/dist/parquet-exporter.d.ts.map +1 -1
- package/dist/parquet-exporter.js +1 -0
- package/dist/parquet-exporter.js.map +1 -1
- package/dist/property-value-serialization.d.ts +54 -0
- package/dist/property-value-serialization.d.ts.map +1 -0
- package/dist/property-value-serialization.js +134 -0
- package/dist/property-value-serialization.js.map +1 -0
- package/dist/reference-collector.d.ts +20 -0
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +46 -113
- package/dist/reference-collector.js.map +1 -1
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +46 -96
- package/dist/schema-converter.js.map +1 -1
- package/dist/source-ref-bounds.d.ts +3 -3
- package/dist/source-ref-bounds.js +3 -3
- package/dist/step-attribute-mutations.d.ts +49 -0
- package/dist/step-attribute-mutations.d.ts.map +1 -0
- package/dist/step-attribute-mutations.js +172 -0
- package/dist/step-attribute-mutations.js.map +1 -0
- package/dist/step-attribute-serializers.d.ts +41 -0
- package/dist/step-attribute-serializers.d.ts.map +1 -0
- package/dist/step-attribute-serializers.js +74 -0
- package/dist/step-attribute-serializers.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 +126 -0
- package/dist/step-collection.js.map +1 -0
- package/dist/step-export-contexts.d.ts +61 -0
- package/dist/step-export-contexts.d.ts.map +1 -0
- package/dist/step-export-contexts.js +50 -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 +23 -354
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +76 -1260
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-geometry-types.d.ts +3 -0
- package/dist/step-geometry-types.d.ts.map +1 -0
- package/dist/step-geometry-types.js +73 -0
- package/dist/step-geometry-types.js.map +1 -0
- package/dist/step-georeferencing.d.ts +0 -10
- package/dist/step-georeferencing.d.ts.map +1 -1
- package/dist/step-georeferencing.js +46 -94
- package/dist/step-georeferencing.js.map +1 -1
- package/dist/step-header.d.ts +53 -0
- package/dist/step-header.d.ts.map +1 -0
- package/dist/step-header.js +63 -0
- package/dist/step-header.js.map +1 -0
- package/dist/step-map-unit.d.ts +90 -0
- package/dist/step-map-unit.d.ts.map +1 -0
- package/dist/step-map-unit.js +277 -0
- package/dist/step-map-unit.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-attribute-overrides.d.ts +32 -0
- package/dist/step-overlay-attribute-overrides.d.ts.map +1 -0
- package/dist/step-overlay-attribute-overrides.js +83 -0
- package/dist/step-overlay-attribute-overrides.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 +45 -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-set-collection.d.ts +24 -0
- package/dist/step-property-set-collection.d.ts.map +1 -0
- package/dist/step-property-set-collection.js +286 -0
- package/dist/step-property-set-collection.js.map +1 -0
- package/dist/step-property-set-generators.d.ts +20 -0
- package/dist/step-property-set-generators.d.ts.map +1 -0
- package/dist/step-property-set-generators.js +98 -0
- package/dist/step-property-set-generators.js.map +1 -0
- package/dist/step-property-set-index.d.ts +25 -0
- package/dist/step-property-set-index.d.ts.map +1 -0
- package/dist/step-property-set-index.js +69 -0
- package/dist/step-property-set-index.js.map +1 -0
- package/dist/step-property-set-readers.d.ts +158 -0
- package/dist/step-property-set-readers.d.ts.map +1 -0
- package/dist/step-property-set-readers.js +251 -0
- package/dist/step-property-set-readers.js.map +1 -0
- package/dist/step-property-sets.d.ts +2 -184
- package/dist/step-property-sets.d.ts.map +1 -1
- package/dist/step-property-sets.js +22 -674
- package/dist/step-property-sets.js.map +1 -1
- package/dist/step-serialization.d.ts +33 -52
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +69 -131
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-source-iteration.d.ts +97 -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
|
@@ -0,0 +1,50 @@
|
|
|
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 { applySourceLineMutations } from './step-attribute-mutations.js';
|
|
5
|
+
import { applyOverlayEntityOverrides } from './step-overlay-attribute-overrides.js';
|
|
6
|
+
import { relationshipWithheldWarning } from './step-export-types.js';
|
|
7
|
+
import { isGeometryEntity } from './step-geometry-types.js';
|
|
8
|
+
/**
|
|
9
|
+
* The state `step-source-iteration.ts` cannot read off the pass (#2475 2d).
|
|
10
|
+
*
|
|
11
|
+
* No `allocateExpressId`: that phase never allocates an id, it only rewrites
|
|
12
|
+
* lines that already have one. `applySourceLineMutations` (a free function in
|
|
13
|
+
* `step-attribute-mutations.ts`, closed over `mutationView` here) and
|
|
14
|
+
* `isGeometryEntity` are injected rather than read off the pass because each
|
|
15
|
+
* has readers outside this phase — the mutation pipeline is shared with the
|
|
16
|
+
* type-object `HasPropertySets` rewrite (see `StepExporter`'s
|
|
17
|
+
* `propertySetContext`, which stays a method because it mints express ids) and
|
|
18
|
+
* with the overlay-created-entities block in `export()`; `isGeometryEntity`
|
|
19
|
+
* with the visible-only setup closure and that same block.
|
|
20
|
+
*
|
|
21
|
+
* `propertySetContext` arrives as a THUNK, not a value: the phase calls it
|
|
22
|
+
* per use and the original method rebuilt it per call, which is the behaviour
|
|
23
|
+
* being preserved.
|
|
24
|
+
*/
|
|
25
|
+
export function buildSourceIterationContext(dataStore, mutationView, propertySetContext) {
|
|
26
|
+
return {
|
|
27
|
+
dataStore,
|
|
28
|
+
applySourceLineMutations: (expressId, entityText, recordType, attributeMutations, sourceSchema, overlayActive, onRejected) => applySourceLineMutations(mutationView, expressId, entityText, recordType, attributeMutations, sourceSchema, overlayActive, onRejected),
|
|
29
|
+
isGeometryEntity,
|
|
30
|
+
propertySetContext,
|
|
31
|
+
relationshipWithheldWarning,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The state `step-overlay-entities.ts` cannot read off the pass (#2475
|
|
36
|
+
* step 2e). `applyOverlayEntityOverrides` is the free function
|
|
37
|
+
* `step-overlay-attribute-overrides.ts` exports; `isGeometryEntity` and
|
|
38
|
+
* `relationshipWithheldWarning` are the same shared readers
|
|
39
|
+
* {@link buildSourceIterationContext} already injects into the other output
|
|
40
|
+
* pass.
|
|
41
|
+
*/
|
|
42
|
+
export function buildOverlayEntitiesContext(mutationView) {
|
|
43
|
+
return {
|
|
44
|
+
mutationView,
|
|
45
|
+
applyOverlayEntityOverrides,
|
|
46
|
+
isGeometryEntity,
|
|
47
|
+
relationshipWithheldWarning,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=step-export-contexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-export-contexts.js","sourceRoot":"","sources":["../src/step-export-contexts.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAuB,EACvB,YAAwC,EACxC,kBAA4C;IAE5C,OAAO;QACL,SAAS;QACT,wBAAwB,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,CAC3H,wBAAwB,CAAC,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,CAAC;QACxI,gBAAgB;QAChB,kBAAkB;QAClB,2BAA2B;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAAwC;IAExC,OAAO;QACL,YAAY;QACZ,2BAA2B;QAC3B,gBAAgB;QAChB,2BAA2B;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vocabulary of a STEP export: what a caller asks for, what it gets back,
|
|
3
|
+
* and the state one `export()` call threads through its phases.
|
|
4
|
+
*
|
|
5
|
+
* Split out of `step-exporter.ts` for #2475. These are declarations only -- no
|
|
6
|
+
* behaviour lives here beyond one message builder -- which is why they could
|
|
7
|
+
* move without touching a single guard.
|
|
8
|
+
*
|
|
9
|
+
* Two ways in, deliberately. The seven sibling modules that already imported
|
|
10
|
+
* `ExportPass` / `SourceLineMutations` still import them from
|
|
11
|
+
* `step-exporter.js`, which re-exports this file, so no existing call site
|
|
12
|
+
* moved and the package's public entry point is untouched. Code written since
|
|
13
|
+
* the split imports straight from here instead -- `step-pass-builder.ts` does
|
|
14
|
+
* -- because the re-export exists to avoid churning callers, not as a channel
|
|
15
|
+
* anything new should be routed through.
|
|
16
|
+
*/
|
|
17
|
+
import type { IfcAttributeValue, IfcSourceHeader, MapConversion, ProjectedCRS } from '@ifc-lite/parser';
|
|
18
|
+
import type { PropertySet, QuantitySet } from '@ifc-lite/data';
|
|
19
|
+
import type { RandomSource } from '@ifc-lite/encoding';
|
|
20
|
+
import type { IfcSchemaVersion } from './schema-converter.js';
|
|
21
|
+
import type { ModificationLedger, SourceLineDelivery } from './delta-modification-ledger.js';
|
|
22
|
+
import type { EffectiveEntityIndex } from './effective-index.js';
|
|
23
|
+
import type { createSourceRefReader } from './source-ref-bounds.js';
|
|
24
|
+
/**
|
|
25
|
+
* Options for STEP export
|
|
26
|
+
*/
|
|
27
|
+
export interface StepExportOptions {
|
|
28
|
+
/** IFC schema version for the output file (any version, will convert if needed) */
|
|
29
|
+
schema: 'IFC2X3' | 'IFC4' | 'IFC4X3' | 'IFC5';
|
|
30
|
+
/** File description */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Author name */
|
|
33
|
+
author?: string;
|
|
34
|
+
/** Organization name */
|
|
35
|
+
organization?: string;
|
|
36
|
+
/** Application name (defaults to 'ifc-lite') */
|
|
37
|
+
application?: string;
|
|
38
|
+
/** Output filename */
|
|
39
|
+
filename?: string;
|
|
40
|
+
/** Include original geometry entities (default: true) */
|
|
41
|
+
includeGeometry?: boolean;
|
|
42
|
+
/** Include property sets (default: true) */
|
|
43
|
+
includeProperties?: boolean;
|
|
44
|
+
/** Include quantity sets (default: true) */
|
|
45
|
+
includeQuantities?: boolean;
|
|
46
|
+
/** Include relationships (default: true) */
|
|
47
|
+
includeRelationships?: boolean;
|
|
48
|
+
/** Apply mutations from MutablePropertyView (default: true if provided) */
|
|
49
|
+
applyMutations?: boolean;
|
|
50
|
+
/** Only export entities with mutations (delta export) */
|
|
51
|
+
deltaOnly?: boolean;
|
|
52
|
+
/** Only export entities currently visible in the viewer */
|
|
53
|
+
visibleOnly?: boolean;
|
|
54
|
+
/** Hidden entity IDs (local expressIds) — required when visibleOnly is true */
|
|
55
|
+
hiddenEntityIds?: Set<number>;
|
|
56
|
+
/** Isolated entity IDs (local expressIds, null = no isolation active) */
|
|
57
|
+
isolatedEntityIds?: Set<number> | null;
|
|
58
|
+
/** Georeferencing mutations to apply (IfcProjectedCRS / IfcMapConversion edits) */
|
|
59
|
+
georefMutations?: {
|
|
60
|
+
projectedCRS?: Partial<ProjectedCRS>;
|
|
61
|
+
mapConversion?: Partial<MapConversion>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Seeded randomness for the GlobalIds this exporter SYNTHESIZES:
|
|
65
|
+
* the `IfcPropertySet` / `IfcElementQuantity` roots regenerated for
|
|
66
|
+
* mutated (or overlay-created) property and quantity sets, their
|
|
67
|
+
* `IfcRelDefinesByProperties` links. Without it those come from the platform
|
|
68
|
+
* CSPRNG, so two exports of the same model differ in exactly those bytes -
|
|
69
|
+
* which breaks byte-reproducibility for in-store builds that call
|
|
70
|
+
* `addPropertySet` / `addQuantitySet` (the sets themselves live in the
|
|
71
|
+
* mutation overlay and only become IFC roots here). Pass the same seeded
|
|
72
|
+
* source used for `SpatialAnchor.guidRandom` to close that gap. Default
|
|
73
|
+
* (omitted) behaviour for THESE ids is unchanged: random.
|
|
74
|
+
*
|
|
75
|
+
* NOT the `IFCPROXY` placeholders any more (#2733). Those used to be minted
|
|
76
|
+
* from this source too, so an omitted `guidRandom` made every downgraded
|
|
77
|
+
* IFC4X3 entity differ on re-export. They are now derived from the source
|
|
78
|
+
* line when this is omitted, and only fall back to this source when it is
|
|
79
|
+
* supplied - so passing a seeded source still pins them, but NOT passing one
|
|
80
|
+
* no longer makes them random. See `convertStepLine`.
|
|
81
|
+
*/
|
|
82
|
+
guidRandom?: RandomSource;
|
|
83
|
+
/**
|
|
84
|
+
* Pin the STEP header `FILE_NAME` timestamp (STEP format, e.g.
|
|
85
|
+
* `20240101T000000`). Omitted = the wall clock, as before. Required for
|
|
86
|
+
* genuinely byte-identical exports, since the header otherwise carries the
|
|
87
|
+
* export instant.
|
|
88
|
+
*/
|
|
89
|
+
timeStamp?: string;
|
|
90
|
+
/** Progress callback for async export */
|
|
91
|
+
onProgress?: (progress: StepExportProgress) => void;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Progress information during STEP export
|
|
95
|
+
*/
|
|
96
|
+
export interface StepExportProgress {
|
|
97
|
+
/** Current phase of export */
|
|
98
|
+
phase: 'preparing' | 'entities' | 'assembling';
|
|
99
|
+
/** Progress 0-1 */
|
|
100
|
+
percent: number;
|
|
101
|
+
/** Number of entities processed so far */
|
|
102
|
+
entitiesProcessed: number;
|
|
103
|
+
/** Total entities to process */
|
|
104
|
+
entitiesTotal: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Result of STEP export
|
|
108
|
+
*/
|
|
109
|
+
export interface StepExportResult {
|
|
110
|
+
/** STEP file content as bytes (avoids V8 string length limit for large files) */
|
|
111
|
+
content: Uint8Array;
|
|
112
|
+
/** Statistics about the export */
|
|
113
|
+
stats: {
|
|
114
|
+
/** Total entities exported */
|
|
115
|
+
entityCount: number;
|
|
116
|
+
/** New entities created for mutations */
|
|
117
|
+
newEntityCount: number;
|
|
118
|
+
/** Entities modified by mutations */
|
|
119
|
+
modifiedEntityCount: number;
|
|
120
|
+
/** File size in bytes */
|
|
121
|
+
fileSize: number;
|
|
122
|
+
/**
|
|
123
|
+
* Non-fatal refusals: things the caller asked for that this export could
|
|
124
|
+
* not write. Empty when the export did everything it was asked to do.
|
|
125
|
+
*
|
|
126
|
+
* A requested `georefMutations.mapConversion` is one case: with no
|
|
127
|
+
* `IfcGeometricRepresentationContext` to reference as `SourceCRS`, the
|
|
128
|
+
* `IfcMapConversion` is skipped (writing it would produce a dangling
|
|
129
|
+
* reference) while the `IfcProjectedCRS` is still written — so the output
|
|
130
|
+
* is indistinguishable from "no map conversion was requested" unless the
|
|
131
|
+
* caller reads this (#2067).
|
|
132
|
+
*
|
|
133
|
+
* A WITHHELD RELATIONSHIP is the other: when a relationship names an
|
|
134
|
+
* entity this export is not writing, in a slot with no spelling for an
|
|
135
|
+
* omitted reference, the whole relationship line is dropped rather than
|
|
136
|
+
* shipped dangling — see {@link relationshipWithheldWarning}. This can
|
|
137
|
+
* happen on a plain full export with no options set at all, so it is
|
|
138
|
+
* reported rather than left to be discovered by a diff.
|
|
139
|
+
*
|
|
140
|
+
* Same `string[]` shape as `MergeExportResult.stats.warnings`.
|
|
141
|
+
*/
|
|
142
|
+
warnings: string[];
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Message for a relationship this export DROPPED rather than rewrote.
|
|
147
|
+
*
|
|
148
|
+
* `filterHiddenRefsFromRelationshipLine` removes an omitted `#N` from a
|
|
149
|
+
* SET/LIST attribute, but a single-valued attribute has no STEP spelling for
|
|
150
|
+
* "omitted" and an empty SET is not the same statement as the original — so in
|
|
151
|
+
* both of those cases it withholds the whole line and the relationship simply
|
|
152
|
+
* is not in the output. Withholding beats shipping a dangling `#N`, but it is
|
|
153
|
+
* not free: every OTHER entity that relationship named loses the association.
|
|
154
|
+
* A visible element can therefore come out of a plain full export with one
|
|
155
|
+
* fewer pset than it went in with, and before this warning existed nothing in
|
|
156
|
+
* the result said so (adversarial review of #2668).
|
|
157
|
+
*
|
|
158
|
+
* Deliberately reports the relationship rather than the omitted target: the
|
|
159
|
+
* target's own omission is already the caller's own doing in every reason but
|
|
160
|
+
* the unreadable-ref one, whereas the lost association is the surprise.
|
|
161
|
+
*/
|
|
162
|
+
export declare const relationshipWithheldWarning: (expressId: number, type: string) => string;
|
|
163
|
+
/**
|
|
164
|
+
* What `step-attribute-mutations.ts`'s `applySourceLineMutations` produced: the rewritten
|
|
165
|
+
* line, plus which edit kinds that rewrite actually delivered. The delivery
|
|
166
|
+
* half is {@link SourceLineDelivery} rather than three loose booleans so that
|
|
167
|
+
* the pipeline and the ledger cannot disagree about what a source line carries
|
|
168
|
+
* — an added kind has one place to be added.
|
|
169
|
+
*/
|
|
170
|
+
export type SourceLineMutations = SourceLineDelivery & {
|
|
171
|
+
text: string;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* The state one `export()` call shares across its seven phases.
|
|
175
|
+
*
|
|
176
|
+
* Introduced by step 1 of #2475: `export()` is ~1267 lines and the phases a
|
|
177
|
+
* split would separate are held together by ~30 local bindings, most of which
|
|
178
|
+
* are read in three or more phases. Naming that set once — as an interface
|
|
179
|
+
* with a single construction site at the top of `export()` — is what lets a
|
|
180
|
+
* later phase extraction take one parameter instead of fifteen.
|
|
181
|
+
*
|
|
182
|
+
* Two properties of this object are load-bearing and must survive every later
|
|
183
|
+
* move:
|
|
184
|
+
*
|
|
185
|
+
* 1. **The predicates are members, not duplicated expressions.** Six of them
|
|
186
|
+
* (`isOverlayCreated`, `isReadableSourceRef`, `isGeometryExcluded`,
|
|
187
|
+
* `hasEmittableHostBytes`, `willBeEmitted`,
|
|
188
|
+
* `isRefExcludedDuringClosureWalk`) exist precisely so two phases cannot
|
|
189
|
+
* disagree about a gate — see the comments at their construction sites for
|
|
190
|
+
* the corrupt files the earlier, per-phase versions let through (#2491,
|
|
191
|
+
* #2414, #2398, #2637). A phase that reimplements one of these instead of
|
|
192
|
+
* reading it off the pass reintroduces exactly that class of defect.
|
|
193
|
+
* 2. **`allowedEntityIds` and `hiddenProductIds` are mutable, and the
|
|
194
|
+
* predicates close over the pass rather than over a snapshot.** Both are
|
|
195
|
+
* assigned AFTER construction, in `step-collection.ts`, and the order there
|
|
196
|
+
* matters more than it looks: `hiddenProductIds` is set first, and
|
|
197
|
+
* `allowedEntityIds` is the value the closure walk on the next line is
|
|
198
|
+
* computing — so `isRefExcludedDuringClosureWalk` is handed to that walk
|
|
199
|
+
* as one of that call's own arguments — while `allowedEntityIds`, and only
|
|
200
|
+
* it, is still null. The
|
|
201
|
+
* output-line filter reads both later, through `isOmittedFromOutput` ->
|
|
202
|
+
* `willBeEmitted`, so neither can be a snapshot taken before the walk ran —
|
|
203
|
+
* that is the invariant the #2637 regression broke.
|
|
204
|
+
*
|
|
205
|
+
* Deliberately NOT on the pass, and why: `isOmittedFromOutput`,
|
|
206
|
+
* `mayNameOmittedRefs` and
|
|
207
|
+
* `overlayNewEntityCount` are eagerly-computed values whose value is only
|
|
208
|
+
* defined after work that runs past this construction site, so hoisting them
|
|
209
|
+
* would change what they compute rather than where they are named;
|
|
210
|
+
* `generatedTypeOwnedPsetIds` is read in one phase only — a local inside
|
|
211
|
+
* `step-property-sets.ts:generatePropertyAndQuantitySetEntities`, which holds
|
|
212
|
+
* both the loop that writes it and the loop that reads it (#2475).
|
|
213
|
+
*/
|
|
214
|
+
export interface ExportPass {
|
|
215
|
+
/** Output accumulator: every DATA-section line this export will write. */
|
|
216
|
+
readonly entities: string[];
|
|
217
|
+
/** Lines contributed by entities that have no source record. */
|
|
218
|
+
newEntityCount: number;
|
|
219
|
+
readonly schema: IfcSchemaVersion;
|
|
220
|
+
readonly sourceSchema: IfcSchemaVersion;
|
|
221
|
+
readonly converting: boolean;
|
|
222
|
+
readonly sourceHeader: IfcSourceHeader | undefined;
|
|
223
|
+
readonly schemaToken: string;
|
|
224
|
+
readonly overlayActive: boolean;
|
|
225
|
+
readonly effective: EffectiveEntityIndex;
|
|
226
|
+
readonly modifications: ModificationLedger;
|
|
227
|
+
/** Widened from the imported `InPlaceNominees` (whose sets are readonly)
|
|
228
|
+
* because the collection passes below add to them. */
|
|
229
|
+
readonly inPlaceNominees: {
|
|
230
|
+
attribute: Set<number>;
|
|
231
|
+
georeferencing: Set<number>;
|
|
232
|
+
};
|
|
233
|
+
allowedEntityIds: Set<number> | null;
|
|
234
|
+
hiddenProductIds: ReadonlySet<number> | null;
|
|
235
|
+
readonly modifiedEntities: Set<number>;
|
|
236
|
+
readonly modifiedAttributes: Map<number, Map<string, string>>;
|
|
237
|
+
readonly newPropertySets: Array<{
|
|
238
|
+
entityId: number;
|
|
239
|
+
psets: PropertySet[];
|
|
240
|
+
}>;
|
|
241
|
+
readonly newQuantitySets: Array<{
|
|
242
|
+
entityId: number;
|
|
243
|
+
qsets: QuantitySet[];
|
|
244
|
+
}>;
|
|
245
|
+
readonly typeOwnedPsetNamesByEntity: Map<number, Set<string>>;
|
|
246
|
+
readonly typeOwnedPsetIdsByEntity: Map<number, number[]>;
|
|
247
|
+
readonly rewrittenEntityIds: Set<number>;
|
|
248
|
+
readonly rewrittenEntityLines: Map<number, string>;
|
|
249
|
+
readonly overlayTypeOwnedPsets: Map<number, IfcAttributeValue>;
|
|
250
|
+
readonly skipPropertySetIds: Set<number>;
|
|
251
|
+
readonly skipRelationshipIds: Set<number>;
|
|
252
|
+
readonly newGeorefLines: string[];
|
|
253
|
+
readonly warnings: string[];
|
|
254
|
+
readonly buildHeader: (modifications: number) => string;
|
|
255
|
+
readonly isOverlayCreated: (entityId: number) => boolean;
|
|
256
|
+
readonly isReadableSourceRef: ReturnType<typeof createSourceRefReader>;
|
|
257
|
+
readonly isGeometryExcluded: (entityId: number, recordType: string) => boolean;
|
|
258
|
+
readonly hasEmittableHostBytes: (entityId: number) => boolean;
|
|
259
|
+
readonly willBeEmitted: (entityId: number) => boolean;
|
|
260
|
+
readonly isRefExcludedDuringClosureWalk: (id: number) => boolean;
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=step-export-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-export-types.d.ts","sourceRoot":"","sources":["../src/step-export-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yDAAyD;IACzD,eAAe,CA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AAM,CAAC;IACxD,QAAQ,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACzD,QAAQ,CAAC,mBAAmB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IACvE,QAAQ,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/E,QAAQ,CAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACtD,QAAQ,CAAC,8BAA8B,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;CAClE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Message for a relationship this export DROPPED rather than rewrote.
|
|
6
|
+
*
|
|
7
|
+
* `filterHiddenRefsFromRelationshipLine` removes an omitted `#N` from a
|
|
8
|
+
* SET/LIST attribute, but a single-valued attribute has no STEP spelling for
|
|
9
|
+
* "omitted" and an empty SET is not the same statement as the original — so in
|
|
10
|
+
* both of those cases it withholds the whole line and the relationship simply
|
|
11
|
+
* is not in the output. Withholding beats shipping a dangling `#N`, but it is
|
|
12
|
+
* not free: every OTHER entity that relationship named loses the association.
|
|
13
|
+
* A visible element can therefore come out of a plain full export with one
|
|
14
|
+
* fewer pset than it went in with, and before this warning existed nothing in
|
|
15
|
+
* the result said so (adversarial review of #2668).
|
|
16
|
+
*
|
|
17
|
+
* Deliberately reports the relationship rather than the omitted target: the
|
|
18
|
+
* target's own omission is already the caller's own doing in every reason but
|
|
19
|
+
* the unreadable-ref one, whereas the lost association is the surprise.
|
|
20
|
+
*/
|
|
21
|
+
export const relationshipWithheldWarning = (expressId, type) => `Relationship #${expressId} (${type}) was withheld from the export: it names at least one entity that has no line in this export, in a slot with no spelling for an omitted reference (a single-valued attribute, or a set whose every member is omitted). Anything else that relationship associated is no longer associated in the output.`;
|
|
22
|
+
//# sourceMappingURL=step-export-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-export-types.js","sourceRoot":"","sources":["../src/step-export-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkK/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAiB,EAAE,IAAY,EAAU,EAAE,CACrF,iBAAiB,SAAS,KAAK,IAAI,0SAA0S,CAAC"}
|