@ifc-lite/parser 5.0.0 → 5.2.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.
Files changed (82) hide show
  1. package/dist/classification-resolver.d.ts +28 -2
  2. package/dist/classification-resolver.d.ts.map +1 -1
  3. package/dist/classification-resolver.js +49 -6
  4. package/dist/classification-resolver.js.map +1 -1
  5. package/dist/columnar-entity-preparation.d.ts +22 -0
  6. package/dist/columnar-entity-preparation.d.ts.map +1 -0
  7. package/dist/columnar-entity-preparation.js +192 -0
  8. package/dist/columnar-entity-preparation.js.map +1 -0
  9. package/dist/columnar-parser-root-attributes.d.ts +66 -0
  10. package/dist/columnar-parser-root-attributes.d.ts.map +1 -0
  11. package/dist/columnar-parser-root-attributes.js +245 -0
  12. package/dist/columnar-parser-root-attributes.js.map +1 -0
  13. package/dist/columnar-parser.d.ts +17 -63
  14. package/dist/columnar-parser.d.ts.map +1 -1
  15. package/dist/columnar-parser.js +371 -779
  16. package/dist/columnar-parser.js.map +1 -1
  17. package/dist/compact-entity-index-columns.d.ts +17 -0
  18. package/dist/compact-entity-index-columns.d.ts.map +1 -0
  19. package/dist/compact-entity-index-columns.js +15 -0
  20. package/dist/compact-entity-index-columns.js.map +1 -0
  21. package/dist/compact-entity-index-transport.d.ts +2 -12
  22. package/dist/compact-entity-index-transport.d.ts.map +1 -1
  23. package/dist/compact-entity-index-transport.js +1 -11
  24. package/dist/compact-entity-index-transport.js.map +1 -1
  25. package/dist/compact-entity-index.d.ts +7 -0
  26. package/dist/compact-entity-index.d.ts.map +1 -1
  27. package/dist/compact-entity-index.js +20 -32
  28. package/dist/compact-entity-index.js.map +1 -1
  29. package/dist/data-store-transport.d.ts +9 -16
  30. package/dist/data-store-transport.d.ts.map +1 -1
  31. package/dist/data-store-transport.js +14 -20
  32. package/dist/data-store-transport.js.map +1 -1
  33. package/dist/entity-refs-from-index.d.ts +10 -0
  34. package/dist/entity-refs-from-index.d.ts.map +1 -1
  35. package/dist/entity-refs-from-index.js +64 -49
  36. package/dist/entity-refs-from-index.js.map +1 -1
  37. package/dist/entity-scanner.d.ts +5 -0
  38. package/dist/entity-scanner.d.ts.map +1 -1
  39. package/dist/entity-scanner.js +20 -7
  40. package/dist/entity-scanner.js.map +1 -1
  41. package/dist/entity-type-byte-interner.d.ts +12 -0
  42. package/dist/entity-type-byte-interner.d.ts.map +1 -0
  43. package/dist/entity-type-byte-interner.js +66 -0
  44. package/dist/entity-type-byte-interner.js.map +1 -0
  45. package/dist/index.d.ts +4 -5
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -5
  48. package/dist/index.js.map +1 -1
  49. package/dist/on-demand-extractors.d.ts +1 -1
  50. package/dist/on-demand-extractors.d.ts.map +1 -1
  51. package/dist/on-demand-georeferencing.d.ts +3 -3
  52. package/dist/on-demand-georeferencing.js +27 -4
  53. package/dist/on-demand-georeferencing.js.map +1 -1
  54. package/dist/parser.worker.d.ts +6 -3
  55. package/dist/parser.worker.d.ts.map +1 -1
  56. package/dist/parser.worker.js +36 -13
  57. package/dist/parser.worker.js.map +1 -1
  58. package/dist/prepass-source-fingerprint.d.ts +3 -0
  59. package/dist/prepass-source-fingerprint.d.ts.map +1 -0
  60. package/dist/prepass-source-fingerprint.js +13 -0
  61. package/dist/prepass-source-fingerprint.js.map +1 -0
  62. package/dist/select-entity-columns.d.ts +7 -0
  63. package/dist/select-entity-columns.d.ts.map +1 -0
  64. package/dist/select-entity-columns.js +43 -0
  65. package/dist/select-entity-columns.js.map +1 -0
  66. package/dist/spatial-hierarchy-builder.d.ts +6 -8
  67. package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
  68. package/dist/spatial-hierarchy-builder.js +4 -0
  69. package/dist/spatial-hierarchy-builder.js.map +1 -1
  70. package/dist/spatial-hierarchy-canonical-parent.d.ts +36 -0
  71. package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -0
  72. package/dist/spatial-hierarchy-canonical-parent.js +63 -0
  73. package/dist/spatial-hierarchy-canonical-parent.js.map +1 -0
  74. package/dist/worker-index-publication.d.ts +43 -0
  75. package/dist/worker-index-publication.d.ts.map +1 -0
  76. package/dist/worker-index-publication.js +129 -0
  77. package/dist/worker-index-publication.js.map +1 -0
  78. package/dist/worker-parser.d.ts +5 -2
  79. package/dist/worker-parser.d.ts.map +1 -1
  80. package/dist/worker-parser.js +30 -12
  81. package/dist/worker-parser.js.map +1 -1
  82. package/package.json +2 -2
@@ -6,6 +6,16 @@ export interface ClassificationInfo {
6
6
  location?: string;
7
7
  description?: string;
8
8
  path?: string[];
9
+ /**
10
+ * True when the relationship graph proves this entity/type carries a
11
+ * classification association, but the classification's own attributes
12
+ * (system, identification, name, path) could not be read because this
13
+ * store has no source bytes — a server-parsed store (issue #3948).
14
+ * Distinguishes "classified but unresolved" from "genuinely unclassified"
15
+ * (an empty result array), which are otherwise byte-identical to every
16
+ * caller. All other fields are left `undefined` on an unresolved entry.
17
+ */
18
+ unresolved?: boolean;
9
19
  }
10
20
  /**
11
21
  * Extract classifications for a single entity ON-DEMAND.
@@ -15,9 +25,25 @@ export interface ClassificationInfo {
15
25
  * Returns an array of classification references with system info.
16
26
  */
17
27
  export declare function extractClassificationsOnDemand(store: IfcDataStore, entityId: number): ClassificationInfo[];
28
+ /** Result of {@link extractClassificationSystemsOnDemand}. */
29
+ export interface ClassificationSystemNames {
30
+ /** Distinct system names, sorted. Empty when the model genuinely has no
31
+ * `IfcClassification` entities — check `unresolved` before reading an
32
+ * empty array as "no systems". */
33
+ names: string[];
34
+ /**
35
+ * True when the model DOES have `IfcClassification` entities (per the
36
+ * byType index) but their `Name` could not be read because this store
37
+ * has no source bytes — a server-parsed store (issue #3948), the same
38
+ * condition `extractClassificationsOnDemand` signals per-entity via
39
+ * `ClassificationInfo.unresolved`. When true, `names` is always `[]`
40
+ * and must not be read as "the model has no classification systems".
41
+ */
42
+ unresolved: boolean;
43
+ }
18
44
  /**
19
45
  * List the distinct classification system names present in a model —
20
- * CHEAP and EXACT.
46
+ * CHEAP and EXACT when source bytes are available.
21
47
  *
22
48
  * Unlike extractClassificationsOnDemand (which resolves classifications for
23
49
  * ONE entity by walking its reference chain, and is only reachable through
@@ -30,5 +56,5 @@ export declare function extractClassificationsOnDemand(store: IfcDataStore, enti
30
56
  * A model can carry SEVERAL systems at once (e.g. Uniclass, OmniClass, and
31
57
  * a national system) — this returns all of them, sorted alphabetically.
32
58
  */
33
- export declare function extractClassificationSystemsOnDemand(store: IfcDataStore): string[];
59
+ export declare function extractClassificationSystemsOnDemand(store: IfcDataStore): ClassificationSystemNames;
34
60
  //# sourceMappingURL=classification-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"classification-resolver.d.ts","sourceRoot":"","sources":["../src/classification-resolver.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,GACjB,kBAAkB,EAAE,CA0EtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoBlF"}
1
+ {"version":3,"file":"classification-resolver.d.ts","sourceRoot":"","sources":["../src/classification-resolver.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,GACjB,kBAAkB,EAAE,CA6GtB;AAED,8DAA8D;AAC9D,MAAM,WAAW,yBAAyB;IACtC;;uCAEmC;IACnC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;;;;;OAOG;IACH,UAAU,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,YAAY,GAAG,yBAAyB,CA2BnG"}
@@ -45,8 +45,44 @@ export function extractClassificationsOnDemand(store, entityId) {
45
45
  }
46
46
  if (!classRefIds || classRefIds.length === 0)
47
47
  return [];
48
- if (!store.source?.length)
49
- return [];
48
+ if (!store.source?.length) {
49
+ // Server-parsed / source-empty store: no source bytes to decode the
50
+ // classification reference's own attributes. The relationship graph
51
+ // above already proved this entity (or its type) IS classified — the
52
+ // ids resolved into `classRefIds` are real
53
+ // `IfcRelAssociatesClassification` targets.
54
+ //
55
+ // If the server also forwarded the resolved attributes (issue
56
+ // #3955), prefer those — real system/identification/name data beats
57
+ // a marker. Roll up the entity's own row plus its type's (mirroring
58
+ // the classRefIds roll-up above) so a type-level classification is
59
+ // not dropped.
60
+ if (store.resolvedClassifications) {
61
+ const resolved = [...(store.resolvedClassifications.get(entityId) || [])];
62
+ if (store.relationships) {
63
+ const typeIds = store.relationships.getRelated(entityId, RelationshipType.DefinesByType, 'inverse');
64
+ for (const typeId of typeIds) {
65
+ const typeResolved = store.resolvedClassifications.get(typeId);
66
+ if (typeResolved)
67
+ resolved.push(...typeResolved);
68
+ }
69
+ }
70
+ // The server resolves these rows from the same immutable input
71
+ // as its graph. Repeated relationships emit repeated rows while
72
+ // the graph deduplicates edges, so their counts need not match.
73
+ if (resolved.length > 0)
74
+ return resolved;
75
+ }
76
+ // No forwarded resolved data. Turning an id into
77
+ // system/identification/name/path needs raw STEP bytes
78
+ // (`EntityExtractor`), which this store doesn't have. Previously
79
+ // this silently returned `[]` here, making a classified entity
80
+ // byte-identical to a genuinely unclassified one (issue #3948).
81
+ // Surface one unresolved marker per resolved id instead, so callers
82
+ // — the IDS bridge in particular — can tell "classified, but this
83
+ // data source can't say more" from "none".
84
+ return classRefIds.map(() => ({ unresolved: true }));
85
+ }
50
86
  const extractor = new EntityExtractor(store.source);
51
87
  const results = [];
52
88
  for (const classRefId of classRefIds) {
@@ -89,7 +125,7 @@ export function extractClassificationsOnDemand(store, entityId) {
89
125
  }
90
126
  /**
91
127
  * List the distinct classification system names present in a model —
92
- * CHEAP and EXACT.
128
+ * CHEAP and EXACT when source bytes are available.
93
129
  *
94
130
  * Unlike extractClassificationsOnDemand (which resolves classifications for
95
131
  * ONE entity by walking its reference chain, and is only reachable through
@@ -104,8 +140,15 @@ export function extractClassificationsOnDemand(store, entityId) {
104
140
  */
105
141
  export function extractClassificationSystemsOnDemand(store) {
106
142
  const ids = store.entityIndex.byType.get('IFCCLASSIFICATION');
107
- if (!ids || ids.length === 0 || !store.source?.length)
108
- return [];
143
+ if (!ids || ids.length === 0)
144
+ return { names: [], unresolved: false };
145
+ if (!store.source?.length) {
146
+ // The model has classification systems (confirmed by the byType
147
+ // index), but reading their Name needs raw STEP bytes this
148
+ // server-parsed store doesn't carry. `[]` alone would be
149
+ // indistinguishable from "no systems" (issue #3948).
150
+ return { names: [], unresolved: true };
151
+ }
109
152
  const extractor = new EntityExtractor(store.source);
110
153
  const names = new Set();
111
154
  for (const id of ids) {
@@ -120,7 +163,7 @@ export function extractClassificationSystemsOnDemand(store) {
120
163
  if (typeof name === 'string' && name.length > 0)
121
164
  names.add(name);
122
165
  }
123
- return Array.from(names).sort();
166
+ return { names: Array.from(names).sort(), unresolved: false };
124
167
  }
125
168
  /**
126
169
  * Walk up the IfcClassificationReference chain to find the root IfcClassification system.
@@ -1 +1 @@
1
- {"version":3,"file":"classification-resolver.js","sourceRoot":"","sources":["../src/classification-resolver.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD;;;;;;GAMG;AACH,MAAM,UAAU,8BAA8B,CAC1C,KAAmB,EACnB,QAAgB;IAEhB,IAAI,WAAiC,CAAC;IAEtC,IAAI,KAAK,CAAC,yBAAyB,EAAE,CAAC;QAClC,WAAW,GAAG,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC;SAAM,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QAC7B,0DAA0D;QAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;QAC/G,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,WAAW,GAAG,OAAO,CAAC;IAClD,CAAC;IAED,gEAAgE;IAChE,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QACpG,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,IAAI,aAAmC,CAAC;YACxC,IAAI,KAAK,CAAC,yBAAyB,EAAE,CAAC;gBAClC,aAAa,GAAG,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,MAA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,MAAM;YAAE,MAAM;QAEnB,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAEtC,IAAI,SAAS,KAAK,mBAAmB,EAAE,CAAC;YACpC,oEAAoE;YACpE,MAAM,UAAU,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACvE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;QACjC,CAAC;QAED,IAAI,SAAS,KAAK,4BAA4B,EAAE,CAAC;YAC7C,qFAAqF;YACrF,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACjE,IAAI,IAAI;gBAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE9B,SAAS,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpE,CAAC;aAAM,CAAC;YACJ,MAAM;QACV,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { EntityRef } from './types.js';
2
+ import type { ScannedEntityColumns } from './entity-refs-from-index.js';
3
+ export type ColumnarEntityInput = EntityRef[] | ScannedEntityColumns;
4
+ /** Shared categorization for scanned objects and pre-pass columns. #3985 */
5
+ export declare function prepareColumnarEntities(input: ColumnarEntityInput, deferPropertyAtomIndex: boolean, yieldIfNeeded: () => Promise<void>): Promise<{
6
+ byType: Map<string, number[]>;
7
+ getTypeUpper: (type: string) => string;
8
+ indexedCount: number;
9
+ propertyAtomCount: number;
10
+ spatialRefs: EntityRef[];
11
+ geometryRefs: EntityRef[];
12
+ relationshipRefs: EntityRef[];
13
+ propertyRelRefs: EntityRef[];
14
+ propertyContainerRefs: EntityRef[];
15
+ associationRelRefs: EntityRef[];
16
+ typeObjectRefs: EntityRef[];
17
+ otherRelevantRefs: EntityRef[];
18
+ groupRefs: EntityRef[];
19
+ buildPrimaryIndex(): Promise<import("./compact-entity-index.js").CompactEntityIndex>;
20
+ buildDeferredIndex(): Promise<import("./compact-entity-index.js").CompactEntityIndex | undefined>;
21
+ }>;
22
+ //# sourceMappingURL=columnar-entity-preparation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"columnar-entity-preparation.d.ts","sourceRoot":"","sources":["../src/columnar-entity-preparation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAUxE,MAAM,MAAM,mBAAmB,GAAG,SAAS,EAAE,GAAG,oBAAoB,CAAC;AAErE,4EAA4E;AAC5E,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,mBAAmB,EAC1B,sBAAsB,EAAE,OAAO,EAC/B,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;;yBAON,MAAM;;;;;;;;;;;;;;GA+JnC"}
@@ -0,0 +1,192 @@
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 { compactEntityIndexFromColumns } from './compact-entity-index-transport.js';
5
+ import { buildCompactEntityIndexAsync } from './compact-entity-index.js';
6
+ import { selectEntityColumns } from './select-entity-columns.js';
7
+ import { getInheritanceChain } from './ifc-schema.js';
8
+ import { GEOMETRY_TYPES, SPATIAL_TYPES, HIERARCHY_REL_TYPES, PROPERTY_REL_TYPES, PROPERTY_ENTITY_TYPES, PROPERTY_CONTAINER_TYPES, ASSOCIATION_REL_TYPES, isIfcTypeLikeEntity, } from './columnar-parser-indexes.js';
9
+ /** Shared categorization for scanned objects and pre-pass columns. #3985 */
10
+ export async function prepareColumnarEntities(input, deferPropertyAtomIndex, yieldIfNeeded) {
11
+ // Single pass: build byType index AND categorize entities simultaneously.
12
+ // Uses a type-name cache to avoid calling .toUpperCase() on 4.4M refs
13
+ // (only ~776 unique type names in IFC4).
14
+ const byType = new Map();
15
+ const typeUpperCache = new Map();
16
+ const getTypeUpper = (type) => {
17
+ let upper = typeUpperCache.get(type);
18
+ if (upper === undefined) {
19
+ upper = type.toUpperCase();
20
+ typeUpperCache.set(type, upper);
21
+ }
22
+ return upper;
23
+ };
24
+ // Non-product helper entities that on-demand extraction / StepExporter
25
+ // need addressable in `byId`. These are not IfcProduct subtypes so the
26
+ // schema-driven IFCPRODUCT subtype check below cannot capture them.
27
+ // Without them, findPreferredGeometricRepresentationContextId() and
28
+ // findLengthUnitReference() fail because the entities are missing from
29
+ // the compact entity index.
30
+ const RELEVANT_NON_PRODUCT_HELPERS = new Set([
31
+ 'IFCGEOMETRICREPRESENTATIONCONTEXT', 'IFCGEOMETRICREPRESENTATIONSUBCONTEXT',
32
+ 'IFCUNITASSIGNMENT', 'IFCSIUNIT', 'IFCCONVERSIONBASEDUNIT',
33
+ 'IFCDERIVEDUNIT', 'IFCDERIVEDUNITELEMENT', 'IFCMEASUREWITHUNIT',
34
+ 'IFCDIMENSIONALEXPONENTS',
35
+ 'IFCMAPCONVERSION', 'IFCPROJECTEDCRS',
36
+ 'IFCMATERIALLAYER', 'IFCMATERIALLAYERSET', 'IFCMATERIALLAYERSETUSAGE',
37
+ 'IFCMATERIALCONSTITUENTSET', 'IFCMATERIALCONSTITUENT',
38
+ 'IFCMATERIALPROFILESET', 'IFCMATERIALPROFILE', 'IFCMATERIAL',
39
+ 'IFCCLASSIFICATION', 'IFCCLASSIFICATIONREFERENCE',
40
+ 'IFCDOCUMENTINFORMATION', 'IFCDOCUMENTREFERENCE',
41
+ ]);
42
+ // Schema-driven inclusion: every IfcProduct subtype belongs in the
43
+ // EntityTable. The previous hardcoded enumeration of IFC4 building-
44
+ // element leaves (IFCWALL, IFCSLAB, …) and IFC4x3 infrastructure
45
+ // leaves (IFCREFERENT, IFCSIGNAL, IFCALIGNMENT, IFCPAVEMENT, …) drifted
46
+ // with every schema bump — new entities silently became CAT_SKIP and
47
+ // disappeared from the hierarchy panel. The generated schema registry
48
+ // already knows the full inheritance chain, so use it.
49
+ const RELEVANT_PRODUCT_ROOTS = new Set(['IFCPRODUCT']);
50
+ // IfcGroup family (IfcZone, IfcSystem, IfcDistributionSystem,
51
+ // IfcBuildingSystem, IfcDistributionCircuit, …). These are NOT
52
+ // IfcProduct subtypes, so without an explicit branch they fall through
53
+ // to CAT_SKIP and never enter the EntityTable — leaving their Name
54
+ // unresolvable (`getName` → '') and making them invisible to
55
+ // `getByType`. The Relationships card then shows "Group #<id>" and the
56
+ // lens/lists can't surface them. Route them into their own bucket so we
57
+ // can extract Name/LongName/ObjectType for the group label (#1075).
58
+ const GROUP_ROOTS = new Set(['IFCGROUP']);
59
+ // Category constants for the lookup cache
60
+ const CAT_SKIP = 0, CAT_SPATIAL = 1, CAT_GEOMETRY = 2, CAT_HIERARCHY_REL = 3, CAT_PROPERTY_REL = 4, CAT_PROPERTY_ENTITY = 5, CAT_ASSOCIATION_REL = 6, CAT_TYPE_OBJECT = 7, CAT_RELEVANT = 8, CAT_GROUP = 9;
61
+ /** Returns true if `upper` (already uppercased) is a subtype of any type in `set`. */
62
+ function isSubtypeOfAny(upper, set) {
63
+ const chain = getInheritanceChain(upper);
64
+ return chain.some(ancestor => set.has(ancestor.toUpperCase()));
65
+ }
66
+ // Cache: type name → category (avoids 4.4M .toUpperCase() calls)
67
+ const typeCategoryCache = new Map();
68
+ function getCategory(type) {
69
+ let cat = typeCategoryCache.get(type);
70
+ if (cat !== undefined)
71
+ return cat;
72
+ const upper = getTypeUpper(type);
73
+ if (SPATIAL_TYPES.has(upper) || isSubtypeOfAny(upper, SPATIAL_TYPES))
74
+ cat = CAT_SPATIAL;
75
+ else if (GEOMETRY_TYPES.has(upper) || isSubtypeOfAny(upper, GEOMETRY_TYPES))
76
+ cat = CAT_GEOMETRY;
77
+ else if (HIERARCHY_REL_TYPES.has(upper))
78
+ cat = CAT_HIERARCHY_REL;
79
+ else if (PROPERTY_REL_TYPES.has(upper))
80
+ cat = CAT_PROPERTY_REL;
81
+ else if (PROPERTY_ENTITY_TYPES.has(upper))
82
+ cat = CAT_PROPERTY_ENTITY;
83
+ else if (ASSOCIATION_REL_TYPES.has(upper))
84
+ cat = CAT_ASSOCIATION_REL;
85
+ else if (isIfcTypeLikeEntity(upper))
86
+ cat = CAT_TYPE_OBJECT;
87
+ else if (isSubtypeOfAny(upper, GROUP_ROOTS))
88
+ cat = CAT_GROUP;
89
+ else if (RELEVANT_NON_PRODUCT_HELPERS.has(upper)
90
+ || isSubtypeOfAny(upper, RELEVANT_PRODUCT_ROOTS)
91
+ || upper.startsWith('IFCREL'))
92
+ cat = CAT_RELEVANT;
93
+ else
94
+ cat = CAT_SKIP;
95
+ typeCategoryCache.set(type, cat);
96
+ return cat;
97
+ }
98
+ const refs = Array.isArray(input) ? input : undefined;
99
+ const columns = Array.isArray(input) ? undefined : input;
100
+ const count = refs ? refs.length : columns.expressIds.length;
101
+ const spatialRefs = [];
102
+ const geometryRefs = [];
103
+ const relationshipRefs = [];
104
+ const propertyRelRefs = [];
105
+ const propertyContainerRefs = [];
106
+ const propertyAtomRefs = [];
107
+ const deferredRows = [];
108
+ let propertyAtomCount = 0;
109
+ const associationRelRefs = [];
110
+ const typeObjectRefs = [];
111
+ const otherRelevantRefs = [];
112
+ const groupRefs = [];
113
+ for (let i = 0; i < count; i++) {
114
+ if ((i & 0x3FF) === 0)
115
+ await yieldIfNeeded();
116
+ const type = refs ? refs[i].type : columns.typeStrings[columns.typeIndices[i]];
117
+ const id = refs ? refs[i].expressId : columns.expressIds[i];
118
+ const cat = getCategory(type);
119
+ const atom = cat === CAT_PROPERTY_ENTITY && !PROPERTY_CONTAINER_TYPES.has(getTypeUpper(type));
120
+ if (!deferPropertyAtomIndex || !atom) {
121
+ const typeKey = getTypeUpper(type);
122
+ let list = byType.get(typeKey);
123
+ if (!list) {
124
+ list = [];
125
+ byType.set(typeKey, list);
126
+ }
127
+ list.push(id);
128
+ }
129
+ if (atom) {
130
+ propertyAtomCount++;
131
+ if (deferPropertyAtomIndex) {
132
+ if (refs)
133
+ propertyAtomRefs.push(refs[i]);
134
+ else
135
+ deferredRows.push(i);
136
+ }
137
+ continue;
138
+ }
139
+ // Helper records still remain in both complete indexes. They do not need
140
+ // a transient EntityRef merely to copy their numeric fields back out.
141
+ if (cat === CAT_SKIP)
142
+ continue;
143
+ const ref = refs ? refs[i] : {
144
+ expressId: id, type, byteOffset: columns.byteOffsets[i],
145
+ byteLength: columns.byteLengths[i], lineNumber: 0,
146
+ };
147
+ if (cat === CAT_SPATIAL)
148
+ spatialRefs.push(ref);
149
+ else if (cat === CAT_GEOMETRY)
150
+ geometryRefs.push(ref);
151
+ else if (cat === CAT_HIERARCHY_REL)
152
+ relationshipRefs.push(ref);
153
+ else if (cat === CAT_PROPERTY_REL)
154
+ propertyRelRefs.push(ref);
155
+ else if (cat === CAT_PROPERTY_ENTITY)
156
+ propertyContainerRefs.push(ref);
157
+ else if (cat === CAT_ASSOCIATION_REL)
158
+ associationRelRefs.push(ref);
159
+ else if (cat === CAT_TYPE_OBJECT)
160
+ typeObjectRefs.push(ref);
161
+ else if (cat === CAT_GROUP)
162
+ groupRefs.push(ref);
163
+ else if (cat === CAT_RELEVANT)
164
+ otherRelevantRefs.push(ref);
165
+ }
166
+ const isPrimary = (type) => !deferPropertyAtomIndex
167
+ || getCategory(type) !== CAT_PROPERTY_ENTITY || PROPERTY_CONTAINER_TYPES.has(getTypeUpper(type));
168
+ const indexedCount = count - (deferPropertyAtomIndex ? propertyAtomCount : 0);
169
+ return {
170
+ byType, getTypeUpper, indexedCount, propertyAtomCount,
171
+ spatialRefs, geometryRefs, relationshipRefs, propertyRelRefs,
172
+ propertyContainerRefs, associationRelRefs, typeObjectRefs, otherRelevantRefs, groupRefs,
173
+ async buildPrimaryIndex() {
174
+ if (refs)
175
+ return buildCompactEntityIndexAsync(deferPropertyAtomIndex ? refs.filter(ref => isPrimary(ref.type)) : refs);
176
+ if (!deferPropertyAtomIndex || propertyAtomCount === 0)
177
+ return compactEntityIndexFromColumns({
178
+ ...columns, typeIndices: columns.typeIndices instanceof Uint16Array
179
+ ? columns.typeIndices : Uint16Array.from(columns.typeIndices),
180
+ });
181
+ return selectEntityColumns(columns, indexedCount, isPrimary);
182
+ },
183
+ async buildDeferredIndex() {
184
+ if (!deferPropertyAtomIndex || propertyAtomCount === 0)
185
+ return undefined;
186
+ if (refs)
187
+ return buildCompactEntityIndexAsync(propertyAtomRefs, undefined, 1024, 2);
188
+ return selectEntityColumns(columns, propertyAtomCount, undefined, deferredRows, 1024, 2);
189
+ },
190
+ };
191
+ }
192
+ //# sourceMappingURL=columnar-entity-preparation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"columnar-entity-preparation.js","sourceRoot":"","sources":["../src/columnar-entity-preparation.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAI/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EACL,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EACtE,qBAAqB,EAAE,wBAAw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OAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAQ,CAAC,WAAW,CAAC;iBAClE,CAAC,CAAC;YACH,OAAO,mBAAmB,CAAC,OAAQ,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QAChE,CAAC;QACD,KAAK,CAAC,kBAAkB;YACtB,IAAI,CAAC,sBAAsB,IAAI,iBAAiB,KAAK,CAAC;gBAAE,OAAO,SAAS,CAAC;YACzE,IAAI,IAAI;gBAAE,OAAO,4BAA4B,CAAC,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACpF,OAAO,mBAAmB,CAAC,OAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC5F,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { EntityRef } from './types.js';
2
+ import type { IfcEntity, IfcAttributeValue } from '@ifc-lite/data';
3
+ import type { IfcDataStore } from './columnar-parser.js';
4
+ export declare function getEntityRefFromStore(store: IfcDataStore, expressId: number): EntityRef | undefined;
5
+ /**
6
+ * Extract entity attributes on-demand from source buffer.
7
+ * Returns globalId, name, description, objectType, tag mapped by schema name
8
+ * (see {@link extractRootAttributesFromEntity}), so the result stays correct
9
+ * for entity types whose attribute order differs from the IfcElement layout.
10
+ * This is used for entities that weren't fully parsed during initial load.
11
+ */
12
+ export declare function extractEntityAttributesOnDemand(store: IfcDataStore, entityId: number): {
13
+ globalId: string;
14
+ name: string;
15
+ description: string;
16
+ objectType: string;
17
+ tag: string;
18
+ };
19
+ /**
20
+ * Extract ALL named entity attributes on-demand from source buffer.
21
+ * Uses the IFC schema to map attribute indices to names.
22
+ * Returns only string/enum attributes, skipping references and structural attributes.
23
+ */
24
+ export declare function extractAllEntityAttributes(store: IfcDataStore, entityId: number): Array<{
25
+ name: string;
26
+ value: string | number | boolean;
27
+ }>;
28
+ /**
29
+ * Returns named raw attribute pairs for an entity, filtered to display-relevant attributes.
30
+ * Skips structural/reference attributes using the IFC schema. Used by query layer for coercion.
31
+ */
32
+ export declare function getRawNamedAttributes(entity: IfcEntity): Array<{
33
+ name: string;
34
+ raw: IfcAttributeValue;
35
+ }>;
36
+ /**
37
+ * Resolve the common IfcRoot-family display attributes (GlobalId, Name,
38
+ * Description, ObjectType, Tag) from an entity's raw attribute array.
39
+ *
40
+ * These are mapped by schema-derived attribute *name*, not fixed index. The
41
+ * fixed indices `[0],[2],[3],[4],[7]` only hold for the IfcElement layout: for
42
+ * a spatial element `attrs[7]` is LongName (not Tag), and for a resource entity
43
+ * like IfcMaterial `attrs[0]` is Name (not GlobalId). Name-mapping keeps all of
44
+ * these correct for every entity type, returning '' for attributes the type
45
+ * does not declare.
46
+ *
47
+ * For types the schema registry does not recognise (e.g. an IFC4x3 infra leaf
48
+ * outside the codegen pin, or a vendor extension) we fall back to the canonical
49
+ * IfcRoot/IfcElement positions so we never regress vs. the old fixed-index path.
50
+ */
51
+ export declare function extractRootAttributesFromEntity(entity: IfcEntity): {
52
+ globalId: string;
53
+ name: string;
54
+ description: string;
55
+ objectType: string;
56
+ tag: string;
57
+ };
58
+ /**
59
+ * Resolve an entity's LongName (IfcZone, IfcSystem subtypes, IfcSpatialZone,
60
+ * IfcBuildingSystem, …) by schema attribute name. Groups frequently leave Name
61
+ * empty and carry their human label in LongName, so consumers fall back to this
62
+ * for the display label. Returns '' when the type does not declare LongName.
63
+ * (#1075)
64
+ */
65
+ export declare function pickLongName(entity: IfcEntity): string;
66
+ //# sourceMappingURL=columnar-parser-root-attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"columnar-parser-root-attributes.d.ts","sourceRoot":"","sources":["../src/columnar-parser-root-attributes.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,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