@ifc-lite/parser 5.1.0 → 6.1.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/classification-resolver.d.ts.map +1 -1
- package/dist/classification-resolver.js +35 -10
- package/dist/classification-resolver.js.map +1 -1
- package/dist/columnar-entity-preparation.d.ts +25 -0
- package/dist/columnar-entity-preparation.d.ts.map +1 -0
- package/dist/columnar-entity-preparation.js +282 -0
- package/dist/columnar-entity-preparation.js.map +1 -0
- package/dist/columnar-parser-indexes.d.ts +17 -1
- package/dist/columnar-parser-indexes.d.ts.map +1 -1
- package/dist/columnar-parser-indexes.js +31 -21
- package/dist/columnar-parser-indexes.js.map +1 -1
- package/dist/columnar-parser-root-attributes.d.ts +66 -0
- package/dist/columnar-parser-root-attributes.d.ts.map +1 -0
- package/dist/columnar-parser-root-attributes.js +245 -0
- package/dist/columnar-parser-root-attributes.js.map +1 -0
- package/dist/columnar-parser.d.ts +26 -63
- package/dist/columnar-parser.d.ts.map +1 -1
- package/dist/columnar-parser.js +384 -751
- package/dist/columnar-parser.js.map +1 -1
- package/dist/compact-entity-index-columns.d.ts +17 -0
- package/dist/compact-entity-index-columns.d.ts.map +1 -0
- package/dist/compact-entity-index-columns.js +15 -0
- package/dist/compact-entity-index-columns.js.map +1 -0
- package/dist/compact-entity-index-transport.d.ts +2 -12
- package/dist/compact-entity-index-transport.d.ts.map +1 -1
- package/dist/compact-entity-index-transport.js +1 -11
- package/dist/compact-entity-index-transport.js.map +1 -1
- package/dist/compact-entity-index.d.ts +6 -0
- package/dist/compact-entity-index.d.ts.map +1 -1
- package/dist/compact-entity-index.js +12 -20
- package/dist/compact-entity-index.js.map +1 -1
- package/dist/cost-extractor.d.ts +10 -0
- package/dist/cost-extractor.d.ts.map +1 -0
- package/dist/cost-extractor.js +369 -0
- package/dist/cost-extractor.js.map +1 -0
- package/dist/cost-schedule-2x3.d.ts +31 -0
- package/dist/cost-schedule-2x3.d.ts.map +1 -0
- package/dist/cost-schedule-2x3.js +75 -0
- package/dist/cost-schedule-2x3.js.map +1 -0
- package/dist/cost-types.d.ts +105 -0
- package/dist/cost-types.d.ts.map +1 -0
- package/dist/cost-types.js +5 -0
- package/dist/cost-types.js.map +1 -0
- package/dist/data-store-transport.d.ts +3 -2
- package/dist/data-store-transport.d.ts.map +1 -1
- package/dist/data-store-transport.js +10 -34
- package/dist/data-store-transport.js.map +1 -1
- package/dist/drop-census.d.ts +136 -0
- package/dist/drop-census.d.ts.map +1 -0
- package/dist/drop-census.js +53 -0
- package/dist/drop-census.js.map +1 -0
- package/dist/entity-refs-from-index.d.ts +10 -0
- package/dist/entity-refs-from-index.d.ts.map +1 -1
- package/dist/entity-refs-from-index.js +52 -36
- package/dist/entity-refs-from-index.js.map +1 -1
- package/dist/entity-scanner.d.ts +5 -0
- package/dist/entity-scanner.d.ts.map +1 -1
- package/dist/entity-scanner.js +30 -12
- package/dist/entity-scanner.js.map +1 -1
- package/dist/entity-type-byte-interner.d.ts +12 -0
- package/dist/entity-type-byte-interner.d.ts.map +1 -0
- package/dist/entity-type-byte-interner.js +66 -0
- package/dist/entity-type-byte-interner.js.map +1 -0
- package/dist/generated/ifc2x3/schema-registry.d.ts +50 -0
- package/dist/generated/ifc2x3/schema-registry.d.ts.map +1 -0
- package/dist/generated/ifc2x3/schema-registry.js +50052 -0
- package/dist/generated/ifc2x3/schema-registry.js.map +1 -0
- package/dist/generated/ifc4x3/schema-registry.d.ts +50 -0
- package/dist/generated/ifc4x3/schema-registry.d.ts.map +1 -0
- package/dist/generated/ifc4x3/schema-registry.js +71299 -0
- package/dist/generated/ifc4x3/schema-registry.js.map +1 -0
- package/dist/generated/schema-registry-by-version.d.ts +61 -0
- package/dist/generated/schema-registry-by-version.d.ts.map +1 -0
- package/dist/generated/schema-registry-by-version.js +86 -0
- package/dist/generated/schema-registry-by-version.js.map +1 -0
- package/dist/group-assignment-factor.d.ts +13 -0
- package/dist/group-assignment-factor.d.ts.map +1 -0
- package/dist/group-assignment-factor.js +30 -0
- package/dist/group-assignment-factor.js.map +1 -0
- package/dist/ifczip.d.ts +6 -0
- package/dist/ifczip.d.ts.map +1 -1
- package/dist/ifczip.js +20 -11
- package/dist/ifczip.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/on-demand-extractors.d.ts +1 -0
- package/dist/on-demand-extractors.d.ts.map +1 -1
- package/dist/on-demand-extractors.js +2 -1
- package/dist/on-demand-extractors.js.map +1 -1
- package/dist/parser.worker.d.ts +6 -3
- package/dist/parser.worker.d.ts.map +1 -1
- package/dist/parser.worker.js +24 -12
- package/dist/parser.worker.js.map +1 -1
- package/dist/prepass-source-fingerprint.d.ts +3 -0
- package/dist/prepass-source-fingerprint.d.ts.map +1 -0
- package/dist/prepass-source-fingerprint.js +13 -0
- package/dist/prepass-source-fingerprint.js.map +1 -0
- package/dist/property-value-parser.d.ts +10 -0
- package/dist/property-value-parser.d.ts.map +1 -1
- package/dist/property-value-parser.js +40 -1
- package/dist/property-value-parser.js.map +1 -1
- package/dist/scan-entities-balanced.d.ts.map +1 -1
- package/dist/scan-entities-balanced.js +8 -6
- package/dist/scan-entities-balanced.js.map +1 -1
- package/dist/scan-worker-lexing.d.ts +14 -0
- package/dist/scan-worker-lexing.d.ts.map +1 -0
- package/dist/scan-worker-lexing.js +101 -0
- package/dist/scan-worker-lexing.js.map +1 -0
- package/dist/scan-worker-source.d.ts +1 -1
- package/dist/scan-worker-source.d.ts.map +1 -1
- package/dist/scan-worker-source.js +61 -59
- package/dist/scan-worker-source.js.map +1 -1
- package/dist/schedule-extractor.d.ts +2 -80
- package/dist/schedule-extractor.d.ts.map +1 -1
- package/dist/schedule-extractor.js +100 -225
- package/dist/schedule-extractor.js.map +1 -1
- package/dist/schedule-serializer-builders.d.ts +28 -0
- package/dist/schedule-serializer-builders.d.ts.map +1 -0
- package/dist/schedule-serializer-builders.js +163 -0
- package/dist/schedule-serializer-builders.js.map +1 -0
- package/dist/schedule-serializer.d.ts +6 -0
- package/dist/schedule-serializer.d.ts.map +1 -1
- package/dist/schedule-serializer.js +26 -165
- package/dist/schedule-serializer.js.map +1 -1
- package/dist/schedule-types.d.ts +211 -0
- package/dist/schedule-types.d.ts.map +1 -0
- package/dist/schedule-types.js +221 -0
- package/dist/schedule-types.js.map +1 -0
- package/dist/select-entity-columns.d.ts +7 -0
- package/dist/select-entity-columns.d.ts.map +1 -0
- package/dist/select-entity-columns.js +43 -0
- package/dist/select-entity-columns.js.map +1 -0
- package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
- package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
- package/dist/spatial-hierarchy-ambiguity.js +25 -0
- package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
- package/dist/spatial-hierarchy-attributes.d.ts +54 -0
- package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
- package/dist/spatial-hierarchy-attributes.js +145 -0
- package/dist/spatial-hierarchy-attributes.js.map +1 -0
- package/dist/spatial-hierarchy-builder.d.ts +6 -38
- package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
- package/dist/spatial-hierarchy-builder.js +48 -166
- package/dist/spatial-hierarchy-builder.js.map +1 -1
- package/dist/spatial-hierarchy-canonical-parent.d.ts +86 -0
- package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -0
- package/dist/spatial-hierarchy-canonical-parent.js +212 -0
- package/dist/spatial-hierarchy-canonical-parent.js.map +1 -0
- package/dist/step-lexing.d.ts +1 -1
- package/dist/step-lexing.d.ts.map +1 -1
- package/dist/step-lexing.js +1 -56
- package/dist/step-lexing.js.map +1 -1
- package/dist/step-record-boundary.d.ts +28 -0
- package/dist/step-record-boundary.d.ts.map +1 -0
- package/dist/step-record-boundary.js +108 -0
- package/dist/step-record-boundary.js.map +1 -0
- package/dist/step-record-boundary.vectors.d.ts +58 -0
- package/dist/step-record-boundary.vectors.d.ts.map +1 -0
- package/dist/step-record-boundary.vectors.js +80 -0
- package/dist/step-record-boundary.vectors.js.map +1 -0
- package/dist/structural-extractor.d.ts +9 -0
- package/dist/structural-extractor.d.ts.map +1 -0
- package/dist/structural-extractor.js +310 -0
- package/dist/structural-extractor.js.map +1 -0
- package/dist/structural-load-extractor.d.ts +147 -0
- package/dist/structural-load-extractor.d.ts.map +1 -0
- package/dist/structural-load-extractor.js +178 -0
- package/dist/structural-load-extractor.js.map +1 -0
- package/dist/structural-step-values.d.ts +51 -0
- package/dist/structural-step-values.d.ts.map +1 -0
- package/dist/structural-step-values.js +109 -0
- package/dist/structural-step-values.js.map +1 -0
- package/dist/structural-types.d.ts +145 -0
- package/dist/structural-types.d.ts.map +1 -0
- package/dist/structural-types.js +5 -0
- package/dist/structural-types.js.map +1 -0
- package/dist/tokenizer.d.ts +11 -5
- package/dist/tokenizer.d.ts.map +1 -1
- package/dist/tokenizer.js +75 -21
- package/dist/tokenizer.js.map +1 -1
- package/dist/wasm-init-retry.d.ts +6 -42
- package/dist/wasm-init-retry.d.ts.map +1 -1
- package/dist/wasm-init-retry.js +6 -99
- package/dist/wasm-init-retry.js.map +1 -1
- package/dist/wasm-panic-forward.d.ts +7 -63
- package/dist/wasm-panic-forward.d.ts.map +1 -1
- package/dist/wasm-panic-forward.js +7 -100
- package/dist/wasm-panic-forward.js.map +1 -1
- package/dist/worker-index-publication.d.ts +43 -0
- package/dist/worker-index-publication.d.ts.map +1 -0
- package/dist/worker-index-publication.js +129 -0
- package/dist/worker-index-publication.js.map +1 -0
- package/dist/worker-parser.d.ts +5 -2
- package/dist/worker-parser.d.ts.map +1 -1
- package/dist/worker-parser.js +22 -10
- package/dist/worker-parser.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,245 @@
|
|
|
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
|
+
* Root-attribute resolution for on-demand entity extraction.
|
|
6
|
+
* Extracted from columnar-parser.ts to keep that module under its size budget.
|
|
7
|
+
*
|
|
8
|
+
* Resolves the common IfcRoot-family display attributes (GlobalId, Name,
|
|
9
|
+
* Description, ObjectType, Tag, LongName) from a raw entity's attribute
|
|
10
|
+
* array by schema-derived attribute name, plus the on-demand "all named
|
|
11
|
+
* attributes" extraction used by the query layer's IDS/property coercion.
|
|
12
|
+
*/
|
|
13
|
+
import { EntityExtractor } from './entity-extractor.js';
|
|
14
|
+
import { getAttributeNames, getAttributeNamesAcrossSchemas } from './ifc-schema.js';
|
|
15
|
+
import { SKIP_DISPLAY_ATTRS } from './columnar-parser-indexes.js';
|
|
16
|
+
export function getEntityRefFromStore(store, expressId) {
|
|
17
|
+
return store.entityIndex.byId.get(expressId) ?? store.deferredEntityIndex?.get(expressId);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extract entity attributes on-demand from source buffer.
|
|
21
|
+
* Returns globalId, name, description, objectType, tag mapped by schema name
|
|
22
|
+
* (see {@link extractRootAttributesFromEntity}), so the result stays correct
|
|
23
|
+
* for entity types whose attribute order differs from the IfcElement layout.
|
|
24
|
+
* This is used for entities that weren't fully parsed during initial load.
|
|
25
|
+
*/
|
|
26
|
+
export function extractEntityAttributesOnDemand(store, entityId) {
|
|
27
|
+
const ref = store.entityIndex.byId.get(entityId);
|
|
28
|
+
if (!ref) {
|
|
29
|
+
return { globalId: '', name: '', description: '', objectType: '', tag: '' };
|
|
30
|
+
}
|
|
31
|
+
const extractor = new EntityExtractor(store.source);
|
|
32
|
+
const entity = extractor.extractEntity(ref);
|
|
33
|
+
if (!entity) {
|
|
34
|
+
return { globalId: '', name: '', description: '', objectType: '', tag: '' };
|
|
35
|
+
}
|
|
36
|
+
return extractRootAttributesFromEntity(entity);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Extract ALL named entity attributes on-demand from source buffer.
|
|
40
|
+
* Uses the IFC schema to map attribute indices to names.
|
|
41
|
+
* Returns only string/enum attributes, skipping references and structural attributes.
|
|
42
|
+
*/
|
|
43
|
+
export function extractAllEntityAttributes(store, entityId) {
|
|
44
|
+
const ref = store.entityIndex.byId.get(entityId);
|
|
45
|
+
if (!ref)
|
|
46
|
+
return [];
|
|
47
|
+
const extractor = new EntityExtractor(store.source);
|
|
48
|
+
const entity = extractor.extractEntity(ref);
|
|
49
|
+
if (!entity)
|
|
50
|
+
return [];
|
|
51
|
+
const attrs = entity.attributes || [];
|
|
52
|
+
// Use properly-cased type name from entity table (IfcTypeEnumToString)
|
|
53
|
+
// instead of ref.type which is UPPERCASE from STEP (e.g., IFCWALLSTANDARDCASE)
|
|
54
|
+
// and breaks multi-word type normalization in getAttributeNames.
|
|
55
|
+
// For resource-level entities (IfcTask, IfcTaskTime, IfcMaterial,
|
|
56
|
+
// IfcClassification, ...) the entity table returns 'Unknown';
|
|
57
|
+
// fall back to ref.type so the schema-driven attribute-name
|
|
58
|
+
// resolution still works for those types.
|
|
59
|
+
const tableName = store.entities.getTypeName(entityId);
|
|
60
|
+
const typeName = tableName && tableName !== 'Unknown' ? tableName : ref.type;
|
|
61
|
+
// Named across the bundled schema union (2X3 + 4 + 4X3), not through the
|
|
62
|
+
// IFC4 codegen pin alone. The pin answers an EMPTY list — not a wrong one —
|
|
63
|
+
// for every class it does not carry, and 251 real classes are outside it:
|
|
64
|
+
// the IFC2X3 ones IFC4 dropped and the whole IFC4X3 infrastructure
|
|
65
|
+
// vocabulary (`IfcCourse`, `IfcPavement`, `IfcKerb`, `IfcSignal`, `IfcRoad`,
|
|
66
|
+
// …). An empty list means this function returns NO attributes for such an
|
|
67
|
+
// entity, so every caller that looks one up by name silently finds nothing
|
|
68
|
+
// and cannot tell that apart from an unset slot. The model-diff adapters
|
|
69
|
+
// read `PredefinedType` this way, which made a cleared `PredefinedType` —
|
|
70
|
+
// the single most common edit in a real infrastructure revision — compare
|
|
71
|
+
// equal to itself on exactly the classes IFC4X3 exists for. Same pinned-
|
|
72
|
+
// registry family as #2001/#2003/#2021.
|
|
73
|
+
//
|
|
74
|
+
// Provably additive: `getAttributeNamesAcrossSchemas` returns the pinned
|
|
75
|
+
// result unchanged whenever the pin has one, so no IFC2X3 or IFC4 entity's
|
|
76
|
+
// attribute list — or the hash anyone derives from it — moves.
|
|
77
|
+
const attrNames = getAttributeNamesAcrossSchemas(typeName);
|
|
78
|
+
const result = [];
|
|
79
|
+
const len = Math.min(attrs.length, attrNames.length);
|
|
80
|
+
for (let i = 0; i < len; i++) {
|
|
81
|
+
const attrName = attrNames[i];
|
|
82
|
+
if (SKIP_DISPLAY_ATTRS.has(attrName))
|
|
83
|
+
continue;
|
|
84
|
+
const raw = attrs[i];
|
|
85
|
+
// STEP `$` (unset) and `*` (derived) deserialize as null /
|
|
86
|
+
// undefined and must be skipped. Strings are emitted with
|
|
87
|
+
// `.ENUM.` markers stripped. Empty strings are preserved so
|
|
88
|
+
// IDS optional-attribute checks can distinguish "slot truly
|
|
89
|
+
// absent" from "slot explicitly empty". Numbers and booleans
|
|
90
|
+
// pass through unchanged so e.g. `CountValue = 0` reads as
|
|
91
|
+
// present.
|
|
92
|
+
if (typeof raw === 'string') {
|
|
93
|
+
// STEP logical-unknown markers (`.U.`, `.X.`) read as
|
|
94
|
+
// "no value" per IDS spec — they fail any attribute
|
|
95
|
+
// check, including a bare existence check, so don't
|
|
96
|
+
// surface them as if the slot were populated.
|
|
97
|
+
if (raw === '.U.' || raw === '.X.')
|
|
98
|
+
continue;
|
|
99
|
+
// Bare boolean tokens (`.T.` / `.F.`) on a schema-typed
|
|
100
|
+
// IfcBoolean attribute slot — resolve to JS boolean so
|
|
101
|
+
// IDS checks comparing against `true` / `false` literals
|
|
102
|
+
// pass without case-sensitive string contortions.
|
|
103
|
+
if (raw === '.T.') {
|
|
104
|
+
result.push({ name: attrName, value: true });
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (raw === '.F.') {
|
|
108
|
+
result.push({ name: attrName, value: false });
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const display = raw.startsWith('.') && raw.endsWith('.')
|
|
112
|
+
? raw.slice(1, -1)
|
|
113
|
+
: raw;
|
|
114
|
+
result.push({ name: attrName, value: display });
|
|
115
|
+
}
|
|
116
|
+
else if (typeof raw === 'number' || typeof raw === 'boolean') {
|
|
117
|
+
result.push({ name: attrName, value: raw });
|
|
118
|
+
}
|
|
119
|
+
else if (Array.isArray(raw) && raw.length === 2) {
|
|
120
|
+
// Typed STEP values like IFCREAL(0.0), IFCBOOLEAN(.T.) —
|
|
121
|
+
// return the underlying primitive so attribute existence
|
|
122
|
+
// and value checks can compare it directly.
|
|
123
|
+
const inner = raw[1];
|
|
124
|
+
const tag = String(raw[0]).toUpperCase();
|
|
125
|
+
if (tag.includes('BOOLEAN')) {
|
|
126
|
+
result.push({ name: attrName, value: inner === '.T.' || inner === true });
|
|
127
|
+
}
|
|
128
|
+
else if (tag.includes('LOGICAL')) {
|
|
129
|
+
if (inner === '.U.' || inner === '.X.') {
|
|
130
|
+
// UNKNOWN logical → don't surface (treated as absent)
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
result.push({ name: attrName, value: inner === '.T.' || inner === true });
|
|
134
|
+
}
|
|
135
|
+
else if (typeof inner === 'number' || typeof inner === 'boolean') {
|
|
136
|
+
result.push({ name: attrName, value: inner });
|
|
137
|
+
}
|
|
138
|
+
else if (typeof inner === 'string' && inner) {
|
|
139
|
+
const display = inner.startsWith('.') && inner.endsWith('.')
|
|
140
|
+
? inner.slice(1, -1)
|
|
141
|
+
: inner;
|
|
142
|
+
result.push({ name: attrName, value: display });
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Returns named raw attribute pairs for an entity, filtered to display-relevant attributes.
|
|
150
|
+
* Skips structural/reference attributes using the IFC schema. Used by query layer for coercion.
|
|
151
|
+
*/
|
|
152
|
+
export function getRawNamedAttributes(entity) {
|
|
153
|
+
const attrs = entity.attributes || [];
|
|
154
|
+
const attrNames = getAttributeNames(entity.type);
|
|
155
|
+
const result = [];
|
|
156
|
+
const len = Math.min(attrs.length, attrNames.length);
|
|
157
|
+
for (let i = 0; i < len; i++) {
|
|
158
|
+
const attrName = attrNames[i];
|
|
159
|
+
if (SKIP_DISPLAY_ATTRS.has(attrName))
|
|
160
|
+
continue;
|
|
161
|
+
result.push({ name: attrName, raw: attrs[i] });
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
// getAttributeNames() walks the schema registry (an O(types) scan for the
|
|
166
|
+
// UPPERCASE STEP names entities carry), so memoise the per-type index lookup.
|
|
167
|
+
// There are only a few hundred distinct types but potentially millions of
|
|
168
|
+
// entities, keeping the on-demand path cheap even when called per entity.
|
|
169
|
+
const rootAttrIndexCache = new Map();
|
|
170
|
+
function getRootAttrIndices(type) {
|
|
171
|
+
let idx = rootAttrIndexCache.get(type);
|
|
172
|
+
if (!idx) {
|
|
173
|
+
const names = getAttributeNames(type);
|
|
174
|
+
idx = {
|
|
175
|
+
known: names.length > 0,
|
|
176
|
+
globalId: names.indexOf('GlobalId'),
|
|
177
|
+
name: names.indexOf('Name'),
|
|
178
|
+
description: names.indexOf('Description'),
|
|
179
|
+
objectType: names.indexOf('ObjectType'),
|
|
180
|
+
tag: names.indexOf('Tag'),
|
|
181
|
+
longName: names.indexOf('LongName'),
|
|
182
|
+
};
|
|
183
|
+
rootAttrIndexCache.set(type, idx);
|
|
184
|
+
}
|
|
185
|
+
return idx;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Resolve the common IfcRoot-family display attributes (GlobalId, Name,
|
|
189
|
+
* Description, ObjectType, Tag) from an entity's raw attribute array.
|
|
190
|
+
*
|
|
191
|
+
* These are mapped by schema-derived attribute *name*, not fixed index. The
|
|
192
|
+
* fixed indices `[0],[2],[3],[4],[7]` only hold for the IfcElement layout: for
|
|
193
|
+
* a spatial element `attrs[7]` is LongName (not Tag), and for a resource entity
|
|
194
|
+
* like IfcMaterial `attrs[0]` is Name (not GlobalId). Name-mapping keeps all of
|
|
195
|
+
* these correct for every entity type, returning '' for attributes the type
|
|
196
|
+
* does not declare.
|
|
197
|
+
*
|
|
198
|
+
* For types the schema registry does not recognise (e.g. an IFC4x3 infra leaf
|
|
199
|
+
* outside the codegen pin, or a vendor extension) we fall back to the canonical
|
|
200
|
+
* IfcRoot/IfcElement positions so we never regress vs. the old fixed-index path.
|
|
201
|
+
*/
|
|
202
|
+
export function extractRootAttributesFromEntity(entity) {
|
|
203
|
+
const attrs = entity.attributes || [];
|
|
204
|
+
const enumIdx = entity.enumAttrIndices;
|
|
205
|
+
const idx = getRootAttrIndices(entity.type);
|
|
206
|
+
const pick = (schemaIndex, fallbackIndex) => {
|
|
207
|
+
const i = idx.known ? schemaIndex : fallbackIndex;
|
|
208
|
+
const raw = i >= 0 ? attrs[i] : undefined;
|
|
209
|
+
if (typeof raw !== 'string')
|
|
210
|
+
return '';
|
|
211
|
+
// Unknown-type fallback only: a fixed index can land on a STEP bare-enum
|
|
212
|
+
// token — e.g. a PredefinedType at attr 7 for a non-IfcElement layout —
|
|
213
|
+
// which must not leak into a Tag/Description cell. Reject by token KIND
|
|
214
|
+
// via the extractor's side channel (#1799), not by dotted-string shape:
|
|
215
|
+
// a quoted string that merely looks like an enum ('.USERDEFINED.')
|
|
216
|
+
// survives, exactly matching the Rust server path (string_at accepts
|
|
217
|
+
// AttributeValue::String and rejects ::Enum, #1779). Skipped for known
|
|
218
|
+
// types, whose schema indices point at genuine string slots.
|
|
219
|
+
if (!idx.known && enumIdx !== undefined && enumIdx.includes(i))
|
|
220
|
+
return '';
|
|
221
|
+
return raw;
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
globalId: pick(idx.globalId, 0),
|
|
225
|
+
name: pick(idx.name, 2),
|
|
226
|
+
description: pick(idx.description, 3),
|
|
227
|
+
objectType: pick(idx.objectType, 4),
|
|
228
|
+
tag: pick(idx.tag, 7),
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Resolve an entity's LongName (IfcZone, IfcSystem subtypes, IfcSpatialZone,
|
|
233
|
+
* IfcBuildingSystem, …) by schema attribute name. Groups frequently leave Name
|
|
234
|
+
* empty and carry their human label in LongName, so consumers fall back to this
|
|
235
|
+
* for the display label. Returns '' when the type does not declare LongName.
|
|
236
|
+
* (#1075)
|
|
237
|
+
*/
|
|
238
|
+
export function pickLongName(entity) {
|
|
239
|
+
const idx = getRootAttrIndices(entity.type);
|
|
240
|
+
if (!idx.known || idx.longName < 0)
|
|
241
|
+
return '';
|
|
242
|
+
const raw = (entity.attributes || [])[idx.longName];
|
|
243
|
+
return typeof raw === 'string' ? raw : '';
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=columnar-parser-root-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnar-parser-root-attributes.js","sourceRoot":"","sources":["../src/columnar-parser-root-attributes.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAKlE,MAAM,UAAU,qBAAqB,CAAC,KAAmB,EAAE,SAAiB;IACxE,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,CAC3C,KAAmB,EACnB,QAAgB;IAEhB,MAAM,GAA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,EAAE,CAAC,CAAC;QACnC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;KACxB,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC1C,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,QAAQ,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9C,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
* Instead of multiple passes through entities, we extract everything in ONE loop.
|
|
6
6
|
*/
|
|
7
7
|
import type { EntityRef } from './types.js';
|
|
8
|
+
import { type ColumnarEntityInput } from './columnar-entity-preparation.js';
|
|
9
|
+
import type { DropCensus } from './drop-census.js';
|
|
8
10
|
import { StringTable, EntityTableBuilder, PropertyTableBuilder, RelationshipGraphBuilder } from '@ifc-lite/data';
|
|
9
|
-
import type { QuantityTable, PropertyValue, IfcStoreBase
|
|
11
|
+
import type { QuantityTable, PropertyValue, IfcStoreBase } from '@ifc-lite/data';
|
|
10
12
|
import type { EntityByIdIndex } from './columnar-parser-indexes.js';
|
|
11
13
|
import { type IfcSourceBytes } from './source-bytes.js';
|
|
14
|
+
export { extractEntityAttributesOnDemand, extractAllEntityAttributes, getRawNamedAttributes, extractRootAttributesFromEntity, } from './columnar-parser-root-attributes.js';
|
|
12
15
|
export type { SpatialIndex, EntityByIdIndex } from './columnar-parser-indexes.js';
|
|
13
16
|
export interface IfcDataStore extends IfcStoreBase {
|
|
14
17
|
parseTime: number;
|
|
@@ -28,6 +31,14 @@ export interface IfcDataStore extends IfcStoreBase {
|
|
|
28
31
|
byType: Map<string, number[]>;
|
|
29
32
|
};
|
|
30
33
|
deferredEntityIndex?: EntityByIdIndex;
|
|
34
|
+
/**
|
|
35
|
+
* Semantic drop census (#4208): per-class scanned/retained counts, the
|
|
36
|
+
* classes the categoriser skipped, classes unknown to the schema
|
|
37
|
+
* registry, and IFCREL* classes seen but not indexed as relationship
|
|
38
|
+
* edges. Always present after a parse — its absence (not a zero count)
|
|
39
|
+
* is what means "the census did not run".
|
|
40
|
+
*/
|
|
41
|
+
dropCensus?: DropCensus;
|
|
31
42
|
strings: StringTable;
|
|
32
43
|
entities: ReturnType<EntityTableBuilder['build']>;
|
|
33
44
|
properties: ReturnType<PropertyTableBuilder['build']>;
|
|
@@ -50,6 +61,8 @@ export interface IfcDataStore extends IfcStoreBase {
|
|
|
50
61
|
* Built from IfcRelAssociatesClassification relationships during parsing.
|
|
51
62
|
*/
|
|
52
63
|
onDemandClassificationMap?: Map<number, number[]>;
|
|
64
|
+
/** Pre-resolved classification attrs, server-parsed path only — #3955. */
|
|
65
|
+
resolvedClassifications?: Map<number, import('./classification-resolver.js').ClassificationInfo[]>;
|
|
53
66
|
/**
|
|
54
67
|
* On-demand material lookup: entityId -> associated material definition expressIds.
|
|
55
68
|
* Built from IfcRelAssociatesMaterial relationships during parsing.
|
|
@@ -74,6 +87,17 @@ export interface IfcDataStore extends IfcStoreBase {
|
|
|
74
87
|
*/
|
|
75
88
|
lengthUnitScale?: number;
|
|
76
89
|
}
|
|
90
|
+
/** Internal implementation shared by public refs and parser-worker columns. */
|
|
91
|
+
export declare function parseColumnarInput(buffer: ArrayBuffer | SharedArrayBuffer, input: ColumnarEntityInput, options?: {
|
|
92
|
+
onProgress?: (progress: {
|
|
93
|
+
phase: string;
|
|
94
|
+
percent: number;
|
|
95
|
+
}) => void;
|
|
96
|
+
onDiagnostic?: (message: string) => void;
|
|
97
|
+
yieldIntervalMs?: number;
|
|
98
|
+
deferPropertyAtomIndex?: boolean;
|
|
99
|
+
onSpatialReady?: (partialStore: IfcDataStore) => void;
|
|
100
|
+
}): Promise<IfcDataStore>;
|
|
77
101
|
export declare class ColumnarParser {
|
|
78
102
|
/**
|
|
79
103
|
* Parse IFC file into columnar data store
|
|
@@ -149,68 +173,7 @@ export declare function extractQuantitiesOnDemand(store: IfcDataStore, entityId:
|
|
|
149
173
|
value: number;
|
|
150
174
|
}>;
|
|
151
175
|
}>;
|
|
152
|
-
|
|
153
|
-
* Extract entity attributes on-demand from source buffer.
|
|
154
|
-
* Returns globalId, name, description, objectType, tag mapped by schema name
|
|
155
|
-
* (see {@link extractRootAttributesFromEntity}), so the result stays correct
|
|
156
|
-
* for entity types whose attribute order differs from the IfcElement layout.
|
|
157
|
-
* This is used for entities that weren't fully parsed during initial load.
|
|
158
|
-
*/
|
|
159
|
-
export declare function extractEntityAttributesOnDemand(store: IfcDataStore, entityId: number): {
|
|
160
|
-
globalId: string;
|
|
161
|
-
name: string;
|
|
162
|
-
description: string;
|
|
163
|
-
objectType: string;
|
|
164
|
-
tag: string;
|
|
165
|
-
};
|
|
166
|
-
/**
|
|
167
|
-
* Extract ALL named entity attributes on-demand from source buffer.
|
|
168
|
-
* Uses the IFC schema to map attribute indices to names.
|
|
169
|
-
* Returns only string/enum attributes, skipping references and structural attributes.
|
|
170
|
-
*/
|
|
171
|
-
export declare function extractAllEntityAttributes(store: IfcDataStore, entityId: number): Array<{
|
|
172
|
-
name: string;
|
|
173
|
-
value: string | number | boolean;
|
|
174
|
-
}>;
|
|
175
|
-
/**
|
|
176
|
-
* Returns named raw attribute pairs for an entity, filtered to display-relevant attributes.
|
|
177
|
-
* Skips structural/reference attributes using the IFC schema. Used by query layer for coercion.
|
|
178
|
-
*/
|
|
179
|
-
export declare function getRawNamedAttributes(entity: IfcEntity): Array<{
|
|
180
|
-
name: string;
|
|
181
|
-
raw: IfcAttributeValue;
|
|
182
|
-
}>;
|
|
183
|
-
/**
|
|
184
|
-
* Resolve the common IfcRoot-family display attributes (GlobalId, Name,
|
|
185
|
-
* Description, ObjectType, Tag) from an entity's raw attribute array.
|
|
186
|
-
*
|
|
187
|
-
* These are mapped by schema-derived attribute *name*, not fixed index. The
|
|
188
|
-
* fixed indices `[0],[2],[3],[4],[7]` only hold for the IfcElement layout: for
|
|
189
|
-
* a spatial element `attrs[7]` is LongName (not Tag), and for a resource entity
|
|
190
|
-
* like IfcMaterial `attrs[0]` is Name (not GlobalId). Name-mapping keeps all of
|
|
191
|
-
* these correct for every entity type, returning '' for attributes the type
|
|
192
|
-
* does not declare.
|
|
193
|
-
*
|
|
194
|
-
* For types the schema registry does not recognise (e.g. an IFC4x3 infra leaf
|
|
195
|
-
* outside the codegen pin, or a vendor extension) we fall back to the canonical
|
|
196
|
-
* IfcRoot/IfcElement positions so we never regress vs. the old fixed-index path.
|
|
197
|
-
*/
|
|
198
|
-
export declare function extractRootAttributesFromEntity(entity: IfcEntity): {
|
|
199
|
-
globalId: string;
|
|
200
|
-
name: string;
|
|
201
|
-
description: string;
|
|
202
|
-
objectType: string;
|
|
203
|
-
tag: string;
|
|
204
|
-
};
|
|
205
|
-
/**
|
|
206
|
-
* Resolve an entity's LongName (IfcZone, IfcSystem subtypes, IfcSpatialZone,
|
|
207
|
-
* IfcBuildingSystem, …) by schema attribute name. Groups frequently leave Name
|
|
208
|
-
* empty and carry their human label in LongName, so consumers fall back to this
|
|
209
|
-
* for the display label. Returns '' when the type does not declare LongName.
|
|
210
|
-
* (#1075)
|
|
211
|
-
*/
|
|
212
|
-
export declare function pickLongName(entity: IfcEntity): string;
|
|
213
|
-
export { extractClassificationsOnDemand, extractClassificationSystemsOnDemand, extractMaterialsOnDemand, extractAllMaterialsOnDemand, extractMaterialPropertiesOnDemand, extractMaterialPropertiesForMaterialId, resolveMaterialDefId, resolveAllMaterialDefIds, collectMaterialLeaves, buildMaterialUsageIndex, getMaterialDisplay, extractTypePropertiesOnDemand, extractTypeEntityOwnProperties, extractTypeQuantitiesOnDemand, extractDocumentsOnDemand, extractRelationshipsOnDemand, extractGroupMembersOnDemand, extractGeoreferencingOnDemand, parsePropertyValue, extractPsetsFromIds, extractQsetsFromIds, } from './on-demand-extractors.js';
|
|
176
|
+
export { extractClassificationsOnDemand, extractClassificationSystemsOnDemand, extractMaterialsOnDemand, extractAllMaterialsOnDemand, extractMaterialPropertiesOnDemand, extractMaterialPropertiesForMaterialId, resolveMaterialDefId, resolveAllMaterialDefIds, collectMaterialLeaves, buildMaterialUsageIndex, getMaterialDisplay, extractTypePropertiesOnDemand, extractTypeEntityOwnProperties, extractTypeQuantitiesOnDemand, extractDocumentsOnDemand, extractRelationshipsOnDemand, extractGroupMembersOnDemand, extractGroupAssignmentFactorOnDemand, extractGeoreferencingOnDemand, parsePropertyValue, extractPsetsFromIds, extractQsetsFromIds, } from './on-demand-extractors.js';
|
|
214
177
|
export { mergeInheritedPropertySets, mergeInheritedQuantitySets } from './property-set-merge.js';
|
|
215
178
|
export type { ClassificationInfo, ClassificationSystemNames, MaterialInfo, MaterialLayerInfo, MaterialProfileInfo, MaterialConstituentInfo, MaterialPsetGroup, MaterialLeaf, MaterialUsage, TypePropertyInfo, TypeQuantityInfo, DocumentInfo, EntityRelationships, GroupMember, GeorefInfo, } from './on-demand-extractors.js';
|
|
216
179
|
//# sourceMappingURL=columnar-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnar-parser.d.ts","sourceRoot":"","sources":["../src/columnar-parser.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"columnar-parser.d.ts","sourceRoot":"","sources":["../src/columnar-parser.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CA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