@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 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-collection.js","sourceRoot":"","sources":["../src/step-property-set-collection.ts"],"names":[],"mappings":"AAAA;;+DAE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CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBACpC,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;oBAC3C,MAAM,QAAQ,GAAG,mBAAmB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;oBACzD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;wBAC/B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;oBACvC,CAAC;oBACD,gEAAgE;oBAChE,+DAA+D;oBAC/D,gEAAgE;oBAChE,gEAAgE;oBAChE,kEAAkE;oBAClE,EAAE;oBACF,0DAA0D;oBAC1D,oDAAoD;oBACpD,kEAAkE;oBAClE,gEAAgE;oBAChE,qCAAqC;oBACrC,mDAAmD;oBACnD,iEAAiE;oBACjE,gEAAgE;oBAChE,kDAAkD;oBAClD,iEAAiE;oBACjE,6DAA6D;oBAC7D,kEAAkE;oBAClE,6DAA6D;oBAC7D,EAAE;oBACF,4DAA4D;oBAC5D,kDAAkD;oBAClD,mEAAmE;oBACnE,kEAAkE;oBAClE,2DAA2D;oBAC3D,6DAA6D;oBAC7D,mEAAmE;oBACnE,8DAA8D;oBAC9D,kEAAkE;oBAClE,WAAW;oBACX,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;gBAC9D,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PropertySet, QuantitySet } from '@ifc-lite/data';
|
|
2
|
+
import type { RandomSource } from '@ifc-lite/encoding';
|
|
3
|
+
import type { EffectiveEntityIndex } from './effective-index.js';
|
|
4
|
+
import { type PropertySetContext } from './step-property-set-readers.js';
|
|
5
|
+
/**
|
|
6
|
+
* Generate STEP entities for property sets
|
|
7
|
+
*/
|
|
8
|
+
export declare function generatePropertySetEntities(ctx: PropertySetContext, entityId: number, psets: PropertySet[], willBeEmitted: (id: number) => boolean, effective: EffectiveEntityIndex, typeOwnedPsetNames?: Set<string>, random?: RandomSource): {
|
|
9
|
+
lines: string[];
|
|
10
|
+
count: number;
|
|
11
|
+
generatedTypeOwnedPsetIds: Map<string, number>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Generate STEP entities for quantity sets (IfcElementQuantity)
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateQuantitySetEntities(ctx: PropertySetContext, entityId: number, qsets: QuantitySet[], willBeEmitted: (id: number) => boolean, random?: RandomSource): {
|
|
17
|
+
lines: string[];
|
|
18
|
+
count: number;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=step-property-set-generators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-generators.d.ts","sourceRoot":"","sources":["../src/step-property-set-generators.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,WAAW,EAAE,EACpB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EACtC,SAAS,EAAE,oBAAoB,EAC/B,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAChC,MAAM,CAAC,EAAE,YAAY,GACpB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAsDpF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,kBAAkB,EACvB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,WAAW,EAAE,EACpB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EACtC,MAAM,CAAC,EAAE,YAAY,GACpB;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwCpC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
* The STEP-entity generators for property sets and quantity sets: the two
|
|
6
|
+
* loops the property-set/quantity-set collection phase's output
|
|
7
|
+
* (`pass.newPropertySets` / `pass.newQuantitySets`) is fed through. Split
|
|
8
|
+
* out of `step-property-sets.ts` (#3184).
|
|
9
|
+
*/
|
|
10
|
+
import { serializeValue, ref } from '@ifc-lite/parser';
|
|
11
|
+
import { escapeStepString, toStepReal, quantityTypeToIfcType } from './step-serialization.js';
|
|
12
|
+
import { serializeNominalValue } from './declared-property-type.js';
|
|
13
|
+
import { findUnitId, generateGlobalId, resolveOwnerHistoryRef, } from './step-property-set-readers.js';
|
|
14
|
+
/**
|
|
15
|
+
* Generate STEP entities for property sets
|
|
16
|
+
*/
|
|
17
|
+
export function generatePropertySetEntities(ctx, entityId, psets, willBeEmitted, effective, typeOwnedPsetNames, random) {
|
|
18
|
+
const lines = [];
|
|
19
|
+
let count = 0;
|
|
20
|
+
const generatedTypeOwnedPsetIds = new Map();
|
|
21
|
+
for (const pset of psets) {
|
|
22
|
+
const propertyIds = [];
|
|
23
|
+
// Create IfcPropertySingleValue for each property
|
|
24
|
+
for (const prop of pset.properties) {
|
|
25
|
+
const propId = ctx.allocateExpressId();
|
|
26
|
+
count++;
|
|
27
|
+
// `prop.dataType`, not `prop.type` alone: regenerating the set rewrites
|
|
28
|
+
// every property in it, and the shape-derived primitive would re-declare
|
|
29
|
+
// the ones nobody edited (`IFCTEXT` → `IFCLABEL`, `IFCLENGTHMEASURE` →
|
|
30
|
+
// `IFCREAL`). See `declared-property-type.ts` for when the source token
|
|
31
|
+
// is trusted (#2482).
|
|
32
|
+
const valueStr = serializeNominalValue(prop.value, prop.type, prop.dataType);
|
|
33
|
+
const unitId = prop.unit ? findUnitId(ctx, prop.unit, effective) : null;
|
|
34
|
+
const unitStr = unitId !== null ? ref(unitId) : null;
|
|
35
|
+
// #ID=IFCPROPERTYSINGLEVALUE('Name',$,Value,Unit);
|
|
36
|
+
const line = `#${propId}=IFCPROPERTYSINGLEVALUE('${escapeStepString(prop.name)}',$,${valueStr},${unitStr ? serializeValue(unitStr) : '$'});`;
|
|
37
|
+
lines.push(line);
|
|
38
|
+
propertyIds.push(propId);
|
|
39
|
+
}
|
|
40
|
+
// Create IfcPropertySet
|
|
41
|
+
const psetId = ctx.allocateExpressId();
|
|
42
|
+
count++;
|
|
43
|
+
const propRefs = propertyIds.map(id => `#${id}`).join(',');
|
|
44
|
+
const globalId = generateGlobalId(random);
|
|
45
|
+
// #ID=IFCPROPERTYSET('GlobalId',#ownerHistory,'Name',$,(#props));
|
|
46
|
+
const psetLine = `#${psetId}=IFCPROPERTYSET('${globalId}',${resolveOwnerHistoryRef(ctx, entityId, willBeEmitted)},'${escapeStepString(pset.name)}',$,(${propRefs}));`;
|
|
47
|
+
lines.push(psetLine);
|
|
48
|
+
if (typeOwnedPsetNames?.has(pset.name)) {
|
|
49
|
+
generatedTypeOwnedPsetIds.set(pset.name, psetId);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// Create IfcRelDefinesByProperties to link pset to entity
|
|
53
|
+
const relId = ctx.allocateExpressId();
|
|
54
|
+
count++;
|
|
55
|
+
const relGlobalId = generateGlobalId(random);
|
|
56
|
+
// #ID=IFCRELDEFINESBYPROPERTIES('GlobalId',#ownerHistory,$,$,(#entity),#pset);
|
|
57
|
+
const relLine = `#${relId}=IFCRELDEFINESBYPROPERTIES('${relGlobalId}',${resolveOwnerHistoryRef(ctx, entityId, willBeEmitted)},$,$,(#${entityId}),#${psetId});`;
|
|
58
|
+
lines.push(relLine);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { lines, count, generatedTypeOwnedPsetIds };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Generate STEP entities for quantity sets (IfcElementQuantity)
|
|
65
|
+
*/
|
|
66
|
+
export function generateQuantitySetEntities(ctx, entityId, qsets, willBeEmitted, random) {
|
|
67
|
+
const lines = [];
|
|
68
|
+
let count = 0;
|
|
69
|
+
for (const qset of qsets) {
|
|
70
|
+
const quantityIds = [];
|
|
71
|
+
for (const q of qset.quantities) {
|
|
72
|
+
const qId = ctx.allocateExpressId();
|
|
73
|
+
count++;
|
|
74
|
+
const ifcType = quantityTypeToIfcType(q.type);
|
|
75
|
+
// #ID=IFCQUANTITYLENGTH('Name',$,$,Value,$);
|
|
76
|
+
const val = toStepReal(q.value);
|
|
77
|
+
const line = `#${qId}=${ifcType}('${escapeStepString(q.name)}',$,$,${val},$);`;
|
|
78
|
+
lines.push(line);
|
|
79
|
+
quantityIds.push(qId);
|
|
80
|
+
}
|
|
81
|
+
// Create IfcElementQuantity
|
|
82
|
+
const qsetId = ctx.allocateExpressId();
|
|
83
|
+
count++;
|
|
84
|
+
const quantRefs = quantityIds.map(id => `#${id}`).join(',');
|
|
85
|
+
const globalId = generateGlobalId(random);
|
|
86
|
+
// #ID=IFCELEMENTQUANTITY('GlobalId',#ownerHistory,'Name',$,$,(#quants));
|
|
87
|
+
const qsetLine = `#${qsetId}=IFCELEMENTQUANTITY('${globalId}',${resolveOwnerHistoryRef(ctx, entityId, willBeEmitted)},'${escapeStepString(qset.name)}',$,$,(${quantRefs}));`;
|
|
88
|
+
lines.push(qsetLine);
|
|
89
|
+
// Create IfcRelDefinesByProperties to link qset to entity
|
|
90
|
+
const relId = ctx.allocateExpressId();
|
|
91
|
+
count++;
|
|
92
|
+
const relGlobalId = generateGlobalId(random);
|
|
93
|
+
const relLine = `#${relId}=IFCRELDEFINESBYPROPERTIES('${relGlobalId}',${resolveOwnerHistoryRef(ctx, entityId, willBeEmitted)},$,$,(#${entityId}),#${qsetId});`;
|
|
94
|
+
lines.push(relLine);
|
|
95
|
+
}
|
|
96
|
+
return { lines, count };
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=step-property-set-generators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-generators.js","sourceRoot":"","sources":["../src/step-property-set-generators.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAEL,UAAU,EACV,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,GAAuB,EACvB,QAAgB,EAChB,KAAoB,EACpB,aAAsC,EACtC,SAA+B,EAC/B,kBAAgC,EAChC,MAAqB;IAErB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,GAAa,EAAE,CAAC;QAEjC,kDAAkD;QAClD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,GAAG,CAAC,iBAAiB,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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reverse index the property-set/quantity-set collection phase
|
|
3
|
+
* (`step-property-set-collection.ts`) pre-computes over
|
|
4
|
+
* IfcRelDefinesByProperties, so the per-entity "find owning rels" step is
|
|
5
|
+
* O(K) rather than O(N) per modified entity. Split out of
|
|
6
|
+
* `step-property-sets.ts` (#3184).
|
|
7
|
+
*/
|
|
8
|
+
import type { PropertySetContext } from './step-property-set-readers.js';
|
|
9
|
+
/**
|
|
10
|
+
* Build a one-shot reverse index of every IfcRelDefinesByProperties in
|
|
11
|
+
* the source: for each related entity, list the rels and property/quantity
|
|
12
|
+
* sets that reference it. Used by the export pre-pass so the per-entity
|
|
13
|
+
* "find owning rels" step is O(K) rather than O(N) per modified entity.
|
|
14
|
+
*
|
|
15
|
+
* `relatedByRel` is the same walk read the other way round, so the deleted-host
|
|
16
|
+
* sweep costs nothing extra.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildRelDefinesByPropertiesIndex(ctx: PropertySetContext): {
|
|
19
|
+
byEntity: Map<number, Array<{
|
|
20
|
+
relId: number;
|
|
21
|
+
psetId: number;
|
|
22
|
+
}>>;
|
|
23
|
+
relatedByRel: Map<number, number[]>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=step-property-set-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-index.d.ts","sourceRoot":"","sources":["../src/step-property-set-index.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,kBAAkB,GAAG;IACzE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAChE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACrC,CAmBA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { entityLineText } from './step-property-set-readers.js';
|
|
5
|
+
/**
|
|
6
|
+
* Build a one-shot reverse index of every IfcRelDefinesByProperties in
|
|
7
|
+
* the source: for each related entity, list the rels and property/quantity
|
|
8
|
+
* sets that reference it. Used by the export pre-pass so the per-entity
|
|
9
|
+
* "find owning rels" step is O(K) rather than O(N) per modified entity.
|
|
10
|
+
*
|
|
11
|
+
* `relatedByRel` is the same walk read the other way round, so the deleted-host
|
|
12
|
+
* sweep costs nothing extra.
|
|
13
|
+
*/
|
|
14
|
+
export function buildRelDefinesByPropertiesIndex(ctx) {
|
|
15
|
+
const byEntity = new Map();
|
|
16
|
+
const relatedByRel = new Map();
|
|
17
|
+
for (const [relId, relRef] of ctx.dataStore.entityIndex.byId) {
|
|
18
|
+
if (relRef.type.toUpperCase() !== 'IFCRELDEFINESBYPROPERTIES')
|
|
19
|
+
continue;
|
|
20
|
+
const psetId = getRelatedPropertySet(ctx, relId);
|
|
21
|
+
if (!psetId)
|
|
22
|
+
continue;
|
|
23
|
+
const related = getRelatedEntities(ctx, relId);
|
|
24
|
+
relatedByRel.set(relId, related);
|
|
25
|
+
for (const entityId of related) {
|
|
26
|
+
let bucket = byEntity.get(entityId);
|
|
27
|
+
if (!bucket) {
|
|
28
|
+
bucket = [];
|
|
29
|
+
byEntity.set(entityId, bucket);
|
|
30
|
+
}
|
|
31
|
+
bucket.push({ relId, psetId });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { byEntity, relatedByRel };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get entity IDs related by IfcRelDefinesByProperties (the related objects)
|
|
38
|
+
*/
|
|
39
|
+
function getRelatedEntities(ctx, relId) {
|
|
40
|
+
const entityText = entityLineText(ctx, relId);
|
|
41
|
+
if (entityText === null)
|
|
42
|
+
return [];
|
|
43
|
+
// Parse IfcRelDefinesByProperties: #ID=IFCRELDEFINESBYPROPERTIES('guid',$,$,$,(#objects),#pset);
|
|
44
|
+
// The 5th argument (index 4) is the list of related objects
|
|
45
|
+
const match = entityText.match(/\(([^)]+)\)\s*,\s*#(\d+)\s*\)\s*;/);
|
|
46
|
+
if (!match)
|
|
47
|
+
return [];
|
|
48
|
+
const objectsList = match[1];
|
|
49
|
+
const refs = [];
|
|
50
|
+
const refMatches = objectsList.matchAll(/#(\d+)/g);
|
|
51
|
+
for (const m of refMatches) {
|
|
52
|
+
refs.push(parseInt(m[1], 10));
|
|
53
|
+
}
|
|
54
|
+
return refs;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the property set ID from IfcRelDefinesByProperties
|
|
58
|
+
*/
|
|
59
|
+
function getRelatedPropertySet(ctx, relId) {
|
|
60
|
+
const entityText = entityLineText(ctx, relId);
|
|
61
|
+
if (entityText === null)
|
|
62
|
+
return null;
|
|
63
|
+
// Last #ID before the closing );
|
|
64
|
+
const match = entityText.match(/,\s*#(\d+)\s*\)\s*;$/);
|
|
65
|
+
if (!match)
|
|
66
|
+
return null;
|
|
67
|
+
return parseInt(match[1], 10);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=step-property-set-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-index.js","sourceRoot":"","sources":["../src/step-property-set-index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,UAAU,gCAAgC,CAAC,GAAuB;IAItE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoD,C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AW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,GAAuB,EAAE,KAAa;IACnE,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,IAAI,UAAU,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAErC,iCAAiC;IACjC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACvD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-side state and helpers for the property-set and quantity-set phases
|
|
3
|
+
* of `StepExporter.export()` (#2475 steps 2b and 2c), split out of
|
|
4
|
+
* `step-property-sets.ts` (#3184): the {@link PropertySetContext} the
|
|
5
|
+
* generation/collection phases run against, the per-entity STEP-text
|
|
6
|
+
* readers those phases share (`entityLineText` and everything parsed from
|
|
7
|
+
* it), and the owner-history resolution the generators call for every
|
|
8
|
+
* record they emit.
|
|
9
|
+
*
|
|
10
|
+
* `isReadableSourceRef` on {@link PropertySetContext} is the exporter's OWN
|
|
11
|
+
* reader rather than the pass's: these readers are also reached from
|
|
12
|
+
* `buildRelDefinesByPropertiesIndex` (`step-property-set-index.ts`) and from
|
|
13
|
+
* `retainSharedAtoms`, neither of which has a pass in hand.
|
|
14
|
+
*/
|
|
15
|
+
import type { IfcDataStore, EntityExtractor } from '@ifc-lite/parser';
|
|
16
|
+
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
17
|
+
import { type RandomSource } from '@ifc-lite/encoding';
|
|
18
|
+
import { createSourceRefReader } from './source-ref-bounds.js';
|
|
19
|
+
import { type EffectiveEntityIndex } from './effective-index.js';
|
|
20
|
+
import type { IfcSchemaVersion } from './schema-converter.js';
|
|
21
|
+
import type { SourceLineMutations } from './step-exporter.js';
|
|
22
|
+
/**
|
|
23
|
+
* The exporter state these phases cannot read off the {@link ExportPass}.
|
|
24
|
+
*
|
|
25
|
+
* `isReadableSourceRef` is the exporter's OWN reader rather than the pass's:
|
|
26
|
+
* the byte readers below are also reached from
|
|
27
|
+
* {@link buildRelDefinesByPropertiesIndex} and from `retainSharedAtoms`,
|
|
28
|
+
* neither of which has a pass in hand. Both readers are built by
|
|
29
|
+
* `createSourceRefReader` over the same `dataStore.source`.
|
|
30
|
+
*/
|
|
31
|
+
export interface PropertySetContext {
|
|
32
|
+
readonly dataStore: IfcDataStore;
|
|
33
|
+
readonly entityExtractor: EntityExtractor | null;
|
|
34
|
+
readonly mutationView: MutablePropertyView | null;
|
|
35
|
+
readonly isReadableSourceRef: ReturnType<typeof createSourceRefReader>;
|
|
36
|
+
/** `() => this.nextExpressId++` on the exporter. */
|
|
37
|
+
readonly allocateExpressId: () => number;
|
|
38
|
+
readonly ownerHistory: OwnerHistoryCache;
|
|
39
|
+
/** `step-attribute-mutations.ts`'s `applySourceLineMutations`: the ONE
|
|
40
|
+
* pipeline the source-iteration pass and the type-object rewrite share, so
|
|
41
|
+
* it belongs to neither phase and is injected. */
|
|
42
|
+
readonly applySourceLineMutations: (expressId: number, entityText: string, recordType: string, attributeMutations: Map<string, string> | undefined, sourceSchema: IfcSchemaVersion, overlayActive: boolean, onRejected?: (attrName: string, value: string) => void) => SourceLineMutations;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The two owner-history memos the generators share, in one object so the
|
|
46
|
+
* exporter can hand them over by reference. Both are per-EXPORT rather than
|
|
47
|
+
* per-exporter; `StepExporter.export()` owns the reset and explains why.
|
|
48
|
+
*/
|
|
49
|
+
export interface OwnerHistoryCache {
|
|
50
|
+
/** Lazily-resolved fallback `#id` of an IfcOwnerHistory that survives the
|
|
51
|
+
* current export closure (or `$` when the file has none). */
|
|
52
|
+
fallbackRef: string | undefined;
|
|
53
|
+
/** Per-host cache of an element's own OwnerHistory ref (`#id` or null). */
|
|
54
|
+
readonly byEntity: Map<number, string | null>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The source STEP text of an entity's line, or `null` when there are no bytes
|
|
58
|
+
* to read.
|
|
59
|
+
*
|
|
60
|
+
* The byte check is on the RANGE, not on `dataStore.source`. `source` is a
|
|
61
|
+
* MANDATORY accessor — `EMPTY_SOURCE_BYTES` is how "this model kept no bytes"
|
|
62
|
+
* is spelled (server-parsed, synthetic, GLB and point-cloud stores all have
|
|
63
|
+
* one) — so the `!ctx.dataStore.source` guard the five readers below used to
|
|
64
|
+
* carry never fired. It was also redundant: a zero-length range decodes to
|
|
65
|
+
* `''`, which fails every regex those readers run, so they already answered
|
|
66
|
+
* "nothing" for a sourceless store. Scoping the check to the range is what
|
|
67
|
+
* makes the guard live without changing a single answer, the same shape and
|
|
68
|
+
* for the same reason as `reference-collector.ts` (#2339).
|
|
69
|
+
*
|
|
70
|
+
* An OVERLAY-created entity never reaches here: every caller resolves its id
|
|
71
|
+
* through `dataStore.entityIndex.byId`, which holds source records only
|
|
72
|
+
* (`effective-index.ts` synthesises the overlay refs on its own side and
|
|
73
|
+
* writes nothing back), so an overlay id is already `undefined` at the
|
|
74
|
+
* lookup and is served by the callers' documented "not a source record"
|
|
75
|
+
* path. That is why an early return is safe HERE and is NOT safe at the
|
|
76
|
+
* visible-only closure in `export` — see the comment there.
|
|
77
|
+
*
|
|
78
|
+
* ## Why `isReadableSourceRef` and not `byteLength === 0`
|
|
79
|
+
*
|
|
80
|
+
* An out-of-range ref does NOT degrade to "no match" here. `decodeUtf8`
|
|
81
|
+
* clamps the range it cannot address, and the clamped window is still a
|
|
82
|
+
* window over real file bytes — so these readers answer from somebody
|
|
83
|
+
* ELSE's record. `source-ref-bounds.ts` (#2491) carries the measured
|
|
84
|
+
* account of both shapes and of why "a clamped, empty decode already yields
|
|
85
|
+
* no match" is false; it is not restated here, because an argument kept in
|
|
86
|
+
* two files is an argument that has to stay true in two files.
|
|
87
|
+
*
|
|
88
|
+
* The consequence specific to THIS site is that the wrong answer is acted
|
|
89
|
+
* on. `retainSharedAtoms` un-skips every id `getPropertyIdsInSet` returns,
|
|
90
|
+
* so a member list read out of the wrong record un-skips the wrong atoms;
|
|
91
|
+
* and the source-iteration pass already refuses to emit a record whose ref
|
|
92
|
+
* fails `isReadableSourceRef` (see the `continue` in `export`), so before
|
|
93
|
+
* this gate these readers were making decisions on behalf of a container
|
|
94
|
+
* that the same export had decided not to write. Gating them on the same
|
|
95
|
+
* predicate is what makes the two passes agree.
|
|
96
|
+
*
|
|
97
|
+
* The degradation is the one the exporter already handles: a record with no
|
|
98
|
+
* emittable bytes, generating nothing and named by nothing. It costs one
|
|
99
|
+
* answer that used to be right by luck — an overrunning ref on the file's
|
|
100
|
+
* LAST record clamps back to exactly that record's text — but that record
|
|
101
|
+
* is one the emission pass drops anyway, so keeping the answer only kept
|
|
102
|
+
* the disagreement.
|
|
103
|
+
*/
|
|
104
|
+
export declare function entityLineText(ctx: PropertySetContext, entityId: number): string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Get the name of a property set by parsing the entity
|
|
107
|
+
*/
|
|
108
|
+
export declare function getPropertySetName(ctx: PropertySetContext, psetId: number): string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Get the name of an element quantity set by parsing the entity
|
|
111
|
+
*/
|
|
112
|
+
export declare function getElementQuantityName(ctx: PropertySetContext, entityId: number): string | null;
|
|
113
|
+
/**
|
|
114
|
+
* Get IDs of properties in a property set
|
|
115
|
+
*/
|
|
116
|
+
export declare function getPropertyIdsInSet(ctx: PropertySetContext, psetId: number): number[];
|
|
117
|
+
/**
|
|
118
|
+
* The full HasPropertySets id list of a type object, from whichever authority
|
|
119
|
+
* owns the record.
|
|
120
|
+
*
|
|
121
|
+
* Slot 5 is `HasPropertySets` on every `IfcTypeObject` subtype. For a source
|
|
122
|
+
* record the list is parsed out of the file; for an overlay-created type it is
|
|
123
|
+
* read off the authored payload, where a reference is the documented `'#42'`
|
|
124
|
+
* string form. Reading only the source made every pset on a created
|
|
125
|
+
* `IfcWallType` look unowned, which is how it ended up on an occurrence
|
|
126
|
+
* relation instead (#2012).
|
|
127
|
+
*/
|
|
128
|
+
export declare function getTypeOwnedHasPropertySetIds(ctx: PropertySetContext, entityId: number, effective: EffectiveEntityIndex): number[];
|
|
129
|
+
/**
|
|
130
|
+
* Resolve a STEP reference to an existing IfcOwnerHistory for the
|
|
131
|
+
* IfcPropertySet / IfcRelDefinesByProperties / IfcElementQuantity entities we
|
|
132
|
+
* generate for `hostEntityId`'s mutations. OwnerHistory is optional in IFC4 but
|
|
133
|
+
* MANDATORY in IFC2X3 (IfcRoot.OwnerHistory), so emitting `$` yields an invalid
|
|
134
|
+
* IFC2X3 file that strict readers (e.g. BIM Vision) reject.
|
|
135
|
+
*
|
|
136
|
+
* Prefer the host element's OWN owner history, then any owner history that
|
|
137
|
+
* survives this export, then `$` only when none does.
|
|
138
|
+
*
|
|
139
|
+
* "Survives" is `willBeEmitted`, the same predicate that decides whether the
|
|
140
|
+
* host itself may have psets generated for it. A reference is a reference: it
|
|
141
|
+
* is no more acceptable to point an emitted `IfcPropertySet` at an owner
|
|
142
|
+
* history the session deleted than at a host it deleted. This used to consult
|
|
143
|
+
* only the `visibleOnly` closure, so an overlay-created OwnerHistory that was
|
|
144
|
+
* later deleted still got referenced — a dangling `#N`, reached through the
|
|
145
|
+
* one attribute the generators fill in for themselves.
|
|
146
|
+
*/
|
|
147
|
+
export declare function resolveOwnerHistoryRef(ctx: PropertySetContext, hostEntityId: number, willBeEmitted: (id: number) => boolean): string;
|
|
148
|
+
/**
|
|
149
|
+
* Generate a new IFC GlobalId (22 character base64). `random` is the
|
|
150
|
+
* export's optional seeded source (`StepExportOptions.guidRandom`);
|
|
151
|
+
* undefined keeps the default random path.
|
|
152
|
+
*/
|
|
153
|
+
export declare function generateGlobalId(random?: RandomSource): string;
|
|
154
|
+
/**
|
|
155
|
+
* Find a unit entity ID by name (simplified - returns null for now)
|
|
156
|
+
*/
|
|
157
|
+
export declare function findUnitId(ctx: PropertySetContext, unitName: string, effective: EffectiveEntityIndex): number | null;
|
|
158
|
+
//# sourceMappingURL=step-property-set-readers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-property-set-readers.d.ts","sourceRoot":"","sources":["../src/step-property-set-readers.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAqB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAe,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAsB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IA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