@ifc-lite/parser 5.2.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.
Files changed (151) hide show
  1. package/dist/columnar-entity-preparation.d.ts +3 -0
  2. package/dist/columnar-entity-preparation.d.ts.map +1 -1
  3. package/dist/columnar-entity-preparation.js +101 -11
  4. package/dist/columnar-entity-preparation.js.map +1 -1
  5. package/dist/columnar-parser-indexes.d.ts +17 -1
  6. package/dist/columnar-parser-indexes.d.ts.map +1 -1
  7. package/dist/columnar-parser-indexes.js +31 -21
  8. package/dist/columnar-parser-indexes.js.map +1 -1
  9. package/dist/columnar-parser.d.ts +10 -1
  10. package/dist/columnar-parser.d.ts.map +1 -1
  11. package/dist/columnar-parser.js +14 -2
  12. package/dist/columnar-parser.js.map +1 -1
  13. package/dist/cost-extractor.d.ts +10 -0
  14. package/dist/cost-extractor.d.ts.map +1 -0
  15. package/dist/cost-extractor.js +369 -0
  16. package/dist/cost-extractor.js.map +1 -0
  17. package/dist/cost-schedule-2x3.d.ts +31 -0
  18. package/dist/cost-schedule-2x3.d.ts.map +1 -0
  19. package/dist/cost-schedule-2x3.js +75 -0
  20. package/dist/cost-schedule-2x3.js.map +1 -0
  21. package/dist/cost-types.d.ts +105 -0
  22. package/dist/cost-types.d.ts.map +1 -0
  23. package/dist/cost-types.js +5 -0
  24. package/dist/cost-types.js.map +1 -0
  25. package/dist/data-store-transport.d.ts +1 -0
  26. package/dist/data-store-transport.d.ts.map +1 -1
  27. package/dist/data-store-transport.js +5 -29
  28. package/dist/data-store-transport.js.map +1 -1
  29. package/dist/drop-census.d.ts +136 -0
  30. package/dist/drop-census.d.ts.map +1 -0
  31. package/dist/drop-census.js +53 -0
  32. package/dist/drop-census.js.map +1 -0
  33. package/dist/entity-scanner.d.ts.map +1 -1
  34. package/dist/entity-scanner.js +10 -5
  35. package/dist/entity-scanner.js.map +1 -1
  36. package/dist/generated/ifc2x3/schema-registry.d.ts +50 -0
  37. package/dist/generated/ifc2x3/schema-registry.d.ts.map +1 -0
  38. package/dist/generated/ifc2x3/schema-registry.js +50052 -0
  39. package/dist/generated/ifc2x3/schema-registry.js.map +1 -0
  40. package/dist/generated/ifc4x3/schema-registry.d.ts +50 -0
  41. package/dist/generated/ifc4x3/schema-registry.d.ts.map +1 -0
  42. package/dist/generated/ifc4x3/schema-registry.js +71299 -0
  43. package/dist/generated/ifc4x3/schema-registry.js.map +1 -0
  44. package/dist/generated/schema-registry-by-version.d.ts +61 -0
  45. package/dist/generated/schema-registry-by-version.d.ts.map +1 -0
  46. package/dist/generated/schema-registry-by-version.js +86 -0
  47. package/dist/generated/schema-registry-by-version.js.map +1 -0
  48. package/dist/group-assignment-factor.d.ts +13 -0
  49. package/dist/group-assignment-factor.d.ts.map +1 -0
  50. package/dist/group-assignment-factor.js +30 -0
  51. package/dist/group-assignment-factor.js.map +1 -0
  52. package/dist/ifczip.d.ts +6 -0
  53. package/dist/ifczip.d.ts.map +1 -1
  54. package/dist/ifczip.js +20 -11
  55. package/dist/ifczip.js.map +1 -1
  56. package/dist/index.d.ts +7 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +13 -2
  59. package/dist/index.js.map +1 -1
  60. package/dist/on-demand-extractors.d.ts +1 -0
  61. package/dist/on-demand-extractors.d.ts.map +1 -1
  62. package/dist/on-demand-extractors.js +2 -1
  63. package/dist/on-demand-extractors.js.map +1 -1
  64. package/dist/property-value-parser.d.ts +10 -0
  65. package/dist/property-value-parser.d.ts.map +1 -1
  66. package/dist/property-value-parser.js +40 -1
  67. package/dist/property-value-parser.js.map +1 -1
  68. package/dist/scan-entities-balanced.d.ts.map +1 -1
  69. package/dist/scan-entities-balanced.js +8 -6
  70. package/dist/scan-entities-balanced.js.map +1 -1
  71. package/dist/scan-worker-lexing.d.ts +14 -0
  72. package/dist/scan-worker-lexing.d.ts.map +1 -0
  73. package/dist/scan-worker-lexing.js +101 -0
  74. package/dist/scan-worker-lexing.js.map +1 -0
  75. package/dist/scan-worker-source.d.ts +1 -1
  76. package/dist/scan-worker-source.d.ts.map +1 -1
  77. package/dist/scan-worker-source.js +61 -59
  78. package/dist/scan-worker-source.js.map +1 -1
  79. package/dist/schedule-extractor.d.ts +2 -80
  80. package/dist/schedule-extractor.d.ts.map +1 -1
  81. package/dist/schedule-extractor.js +100 -225
  82. package/dist/schedule-extractor.js.map +1 -1
  83. package/dist/schedule-serializer-builders.d.ts +28 -0
  84. package/dist/schedule-serializer-builders.d.ts.map +1 -0
  85. package/dist/schedule-serializer-builders.js +163 -0
  86. package/dist/schedule-serializer-builders.js.map +1 -0
  87. package/dist/schedule-serializer.d.ts +6 -0
  88. package/dist/schedule-serializer.d.ts.map +1 -1
  89. package/dist/schedule-serializer.js +26 -165
  90. package/dist/schedule-serializer.js.map +1 -1
  91. package/dist/schedule-types.d.ts +211 -0
  92. package/dist/schedule-types.d.ts.map +1 -0
  93. package/dist/schedule-types.js +221 -0
  94. package/dist/schedule-types.js.map +1 -0
  95. package/dist/spatial-hierarchy-ambiguity.d.ts +39 -0
  96. package/dist/spatial-hierarchy-ambiguity.d.ts.map +1 -0
  97. package/dist/spatial-hierarchy-ambiguity.js +25 -0
  98. package/dist/spatial-hierarchy-ambiguity.js.map +1 -0
  99. package/dist/spatial-hierarchy-attributes.d.ts +54 -0
  100. package/dist/spatial-hierarchy-attributes.d.ts.map +1 -0
  101. package/dist/spatial-hierarchy-attributes.js +145 -0
  102. package/dist/spatial-hierarchy-attributes.js.map +1 -0
  103. package/dist/spatial-hierarchy-builder.d.ts +0 -30
  104. package/dist/spatial-hierarchy-builder.d.ts.map +1 -1
  105. package/dist/spatial-hierarchy-builder.js +45 -167
  106. package/dist/spatial-hierarchy-builder.js.map +1 -1
  107. package/dist/spatial-hierarchy-canonical-parent.d.ts +52 -2
  108. package/dist/spatial-hierarchy-canonical-parent.d.ts.map +1 -1
  109. package/dist/spatial-hierarchy-canonical-parent.js +153 -4
  110. package/dist/spatial-hierarchy-canonical-parent.js.map +1 -1
  111. package/dist/step-lexing.d.ts +1 -1
  112. package/dist/step-lexing.d.ts.map +1 -1
  113. package/dist/step-lexing.js +1 -56
  114. package/dist/step-lexing.js.map +1 -1
  115. package/dist/step-record-boundary.d.ts +28 -0
  116. package/dist/step-record-boundary.d.ts.map +1 -0
  117. package/dist/step-record-boundary.js +108 -0
  118. package/dist/step-record-boundary.js.map +1 -0
  119. package/dist/step-record-boundary.vectors.d.ts +58 -0
  120. package/dist/step-record-boundary.vectors.d.ts.map +1 -0
  121. package/dist/step-record-boundary.vectors.js +80 -0
  122. package/dist/step-record-boundary.vectors.js.map +1 -0
  123. package/dist/structural-extractor.d.ts +9 -0
  124. package/dist/structural-extractor.d.ts.map +1 -0
  125. package/dist/structural-extractor.js +310 -0
  126. package/dist/structural-extractor.js.map +1 -0
  127. package/dist/structural-load-extractor.d.ts +147 -0
  128. package/dist/structural-load-extractor.d.ts.map +1 -0
  129. package/dist/structural-load-extractor.js +178 -0
  130. package/dist/structural-load-extractor.js.map +1 -0
  131. package/dist/structural-step-values.d.ts +51 -0
  132. package/dist/structural-step-values.d.ts.map +1 -0
  133. package/dist/structural-step-values.js +109 -0
  134. package/dist/structural-step-values.js.map +1 -0
  135. package/dist/structural-types.d.ts +145 -0
  136. package/dist/structural-types.d.ts.map +1 -0
  137. package/dist/structural-types.js +5 -0
  138. package/dist/structural-types.js.map +1 -0
  139. package/dist/tokenizer.d.ts +11 -5
  140. package/dist/tokenizer.d.ts.map +1 -1
  141. package/dist/tokenizer.js +75 -21
  142. package/dist/tokenizer.js.map +1 -1
  143. package/dist/wasm-init-retry.d.ts +6 -42
  144. package/dist/wasm-init-retry.d.ts.map +1 -1
  145. package/dist/wasm-init-retry.js +6 -99
  146. package/dist/wasm-init-retry.js.map +1 -1
  147. package/dist/wasm-panic-forward.d.ts +7 -63
  148. package/dist/wasm-panic-forward.d.ts.map +1 -1
  149. package/dist/wasm-panic-forward.js +7 -100
  150. package/dist/wasm-panic-forward.js.map +1 -1
  151. package/package.json +5 -4
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Schedule (4D) shapes and sub-entity extractors — STEP attribute-index
3
+ * layouts for IfcTask / IfcTaskTime / IfcRelSequence / IfcRelAssignsToProcess
4
+ * / IfcRelAssignsToControl / IfcRelNests / IfcWorkSchedule / IfcWorkPlan /
5
+ * IfcLagTime, the public `ScheduleExtraction` record types built from them,
6
+ * and the small pure helpers (`asString` et al.) plus single-entity
7
+ * sub-extractors (`extractTaskTime`, `extractLagTimeSeconds`) that turn one
8
+ * STEP entity's attribute array into a typed field.
9
+ *
10
+ * `schedule-extractor.ts` owns the orchestration — walking `byType` arrays
11
+ * and wiring these records together across passes — and imports everything
12
+ * it needs from here. Splitting "how one entity's attributes decode" from
13
+ * "how entities cross-reference each other" keeps each file to one concern,
14
+ * the same shape as this package's `spatial-hierarchy-canonical-parent.ts`
15
+ * being split out of `spatial-hierarchy-builder.ts`.
16
+ */
17
+ import { EntityExtractor } from './entity-extractor.js';
18
+ import type { IfcDataStore } from './columnar-parser.js';
19
+ /** IFC4 STEP attribute indices for IfcTask. */
20
+ export declare const TASK_ATTR: {
21
+ readonly GlobalId: 0;
22
+ readonly Name: 2;
23
+ readonly Description: 3;
24
+ readonly ObjectType: 4;
25
+ readonly Identification: 5;
26
+ readonly LongDescription: 6;
27
+ readonly Status: 7;
28
+ readonly WorkMethod: 8;
29
+ readonly IsMilestone: 9;
30
+ readonly Priority: 10;
31
+ readonly TaskTime: 11;
32
+ readonly PredefinedType: 12;
33
+ };
34
+ /**
35
+ * IFC2X3 IfcTask layout — the attributes IfcTask itself adds over IfcObject
36
+ * (TaskId, Status, WorkMethod, IsMilestone, Priority). IFC2X3 schedule times
37
+ * live on `IfcScheduleTimeControl` and link to IfcTask via `IfcRelAssignsTasks`
38
+ * — we don't resolve those here yet; best-effort 2x3 models only surface task
39
+ * metadata without dates.
40
+ */
41
+ export declare const TASK_ATTR_2X3: {
42
+ readonly GlobalId: 0;
43
+ readonly Name: 2;
44
+ readonly Description: 3;
45
+ readonly ObjectType: 4;
46
+ readonly TaskId: 5;
47
+ readonly Status: 6;
48
+ readonly WorkMethod: 7;
49
+ readonly IsMilestone: 8;
50
+ readonly Priority: 9;
51
+ };
52
+ export declare const REL_SEQUENCE_ATTR: {
53
+ readonly GlobalId: 0;
54
+ readonly RelatingProcess: 4;
55
+ readonly RelatedProcess: 5;
56
+ readonly TimeLag: 6;
57
+ readonly SequenceType: 7;
58
+ readonly UserDefinedSequenceType: 8;
59
+ };
60
+ export declare const REL_ASSIGNS_TO_PROCESS_ATTR: {
61
+ readonly RelatedObjects: 4;
62
+ readonly RelatingProcess: 6;
63
+ };
64
+ export declare const REL_ASSIGNS_TO_CONTROL_ATTR: {
65
+ readonly RelatedObjects: 4;
66
+ readonly RelatingControl: 6;
67
+ };
68
+ export declare const REL_NESTS_ATTR: {
69
+ readonly RelatingObject: 4;
70
+ readonly RelatedObjects: 5;
71
+ };
72
+ export declare const WORK_SCHEDULE_ATTR: {
73
+ readonly GlobalId: 0;
74
+ readonly Name: 2;
75
+ readonly Description: 3;
76
+ readonly ObjectType: 4;
77
+ readonly Identification: 5;
78
+ readonly CreationDate: 6;
79
+ readonly Purpose: 8;
80
+ readonly Duration: 9;
81
+ readonly TotalFloat: 10;
82
+ readonly StartTime: 11;
83
+ readonly FinishTime: 12;
84
+ readonly PredefinedType: 13;
85
+ };
86
+ export declare const WORK_PLAN_ATTR: {
87
+ readonly GlobalId: 0;
88
+ readonly Name: 2;
89
+ readonly Description: 3;
90
+ readonly ObjectType: 4;
91
+ readonly Identification: 5;
92
+ readonly CreationDate: 6;
93
+ readonly Purpose: 8;
94
+ readonly Duration: 9;
95
+ readonly TotalFloat: 10;
96
+ readonly StartTime: 11;
97
+ readonly FinishTime: 12;
98
+ readonly PredefinedType: 13;
99
+ };
100
+ export type SequenceTypeEnum = 'START_START' | 'START_FINISH' | 'FINISH_START' | 'FINISH_FINISH' | 'USERDEFINED' | 'NOTDEFINED';
101
+ export type TaskDurationType = 'WORKTIME' | 'ELAPSEDTIME' | 'NOTDEFINED';
102
+ export interface ScheduleTaskTimeInfo {
103
+ scheduleStart?: string;
104
+ scheduleFinish?: string;
105
+ scheduleDuration?: string;
106
+ actualStart?: string;
107
+ actualFinish?: string;
108
+ actualDuration?: string;
109
+ earlyStart?: string;
110
+ earlyFinish?: string;
111
+ lateStart?: string;
112
+ lateFinish?: string;
113
+ freeFloat?: string;
114
+ totalFloat?: string;
115
+ remainingTime?: string;
116
+ durationType?: TaskDurationType;
117
+ statusTime?: string;
118
+ isCritical?: boolean;
119
+ completion?: number;
120
+ }
121
+ export interface ScheduleTaskInfo {
122
+ expressId: number;
123
+ globalId: string;
124
+ name: string;
125
+ description?: string;
126
+ objectType?: string;
127
+ identification?: string;
128
+ longDescription?: string;
129
+ status?: string;
130
+ workMethod?: string;
131
+ isMilestone: boolean;
132
+ priority?: number;
133
+ predefinedType?: string;
134
+ taskTime?: ScheduleTaskTimeInfo;
135
+ /** Parent task globalId (from IfcRelNests where this task is in RelatedObjects). */
136
+ parentGlobalId?: string;
137
+ /** Child task globalIds (from IfcRelNests where this task is RelatingObject). */
138
+ childGlobalIds: string[];
139
+ /** expressIds of products assigned to this task via IfcRelAssignsToProcess. */
140
+ productExpressIds: number[];
141
+ /** globalIds of the same products (aligned with productExpressIds by index). */
142
+ productGlobalIds: string[];
143
+ /** WorkSchedule globalIds that control this task via IfcRelAssignsToControl. */
144
+ controllingScheduleGlobalIds: string[];
145
+ }
146
+ export interface ScheduleSequenceInfo {
147
+ globalId: string;
148
+ relatingTaskGlobalId: string;
149
+ relatedTaskGlobalId: string;
150
+ sequenceType: SequenceTypeEnum;
151
+ userDefinedSequenceType?: string;
152
+ /** Lag value expressed in seconds if it resolves to an IfcDuration; otherwise undefined. */
153
+ timeLagSeconds?: number;
154
+ /** Original lag duration string (ISO 8601 like 'P1D'), if available. */
155
+ timeLagDuration?: string;
156
+ }
157
+ export interface WorkScheduleInfo {
158
+ expressId: number;
159
+ globalId: string;
160
+ kind: 'WorkSchedule' | 'WorkPlan';
161
+ name: string;
162
+ description?: string;
163
+ identification?: string;
164
+ creationDate?: string;
165
+ purpose?: string;
166
+ duration?: string;
167
+ startTime?: string;
168
+ finishTime?: string;
169
+ predefinedType?: string;
170
+ /** Root task globalIds directly assigned via IfcRelAssignsToControl. */
171
+ taskGlobalIds: string[];
172
+ /**
173
+ * Parent IfcWorkPlan globalId, when this schedule is nested under a work
174
+ * plan via IfcRelNests (this schedule as a RelatedObject). Undefined for
175
+ * a WorkPlan itself, or a WorkSchedule with no nesting parent.
176
+ */
177
+ parentPlanGlobalId?: string;
178
+ /**
179
+ * Child IfcWorkSchedule globalIds nested under this work plan via
180
+ * IfcRelNests or IfcRelAssignsToControl (this record as the parent side).
181
+ * Empty (or absent) for a plain WorkSchedule, or a WorkPlan with no
182
+ * nested schedules.
183
+ *
184
+ * Optional so a `WorkScheduleInfo` built without any opinion on grouping
185
+ * doesn't have to populate a field it never touches. Absent and `[]` are
186
+ * equivalent everywhere this field is read — neither the extractor nor
187
+ * the serializer distinguishes "unknown/legacy" from "known and empty";
188
+ * both mean "no nested schedules to write or report".
189
+ */
190
+ childScheduleGlobalIds?: string[];
191
+ }
192
+ export interface ScheduleExtraction {
193
+ workSchedules: WorkScheduleInfo[];
194
+ tasks: ScheduleTaskInfo[];
195
+ sequences: ScheduleSequenceInfo[];
196
+ /** True if we encountered any scheduling entity (useful for empty-state UI). */
197
+ hasSchedule: boolean;
198
+ }
199
+ export declare function asString(v: unknown): string | undefined;
200
+ export declare function asNumber(v: unknown): number | undefined;
201
+ export declare function asBoolean(v: unknown): boolean | undefined;
202
+ export declare function asEnum(v: unknown): string | undefined;
203
+ export declare function asRef(v: unknown): number | undefined;
204
+ export declare function asRefList(v: unknown): number[];
205
+ export declare function sequenceTypeFromString(s: string | undefined): SequenceTypeEnum;
206
+ export declare function extractTaskTime(extractor: EntityExtractor, store: IfcDataStore, taskTimeId: number): ScheduleTaskTimeInfo | undefined;
207
+ export declare function extractLagTimeSeconds(extractor: EntityExtractor, store: IfcDataStore, lagId: number): {
208
+ seconds?: number;
209
+ duration?: string;
210
+ };
211
+ //# sourceMappingURL=schedule-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-types.d.ts","sourceRoot":"","sources":["../src/schedule-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,+CAA+C;AAC/C,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAaZ,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;CAUhB,CAAC;AAuBX,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;CAG9B,CAAC;AAEX,eAAO,MAAM,2BAA2B;;;CAG9B,CAAC;AAEX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAarB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAAqB,CAAC;AAOjD,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,cAAc,GACd,cAAc,GACd,eAAe,GACf,aAAa,GACb,YAAY,CAAC;AAEjB,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;I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;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKrD;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAQ9C;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,CAY9E;AAaD,wBAAgB,eAAe,CAC7B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,GACjB,oBAAoB,GAAG,SAAS,CA2BlC;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,MAAM,GACZ;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAoBzC"}
@@ -0,0 +1,221 @@
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 { parseIso8601Duration } from './iso8601-duration.js';
5
+ /** IFC4 STEP attribute indices for IfcTask. */
6
+ export const TASK_ATTR = {
7
+ GlobalId: 0,
8
+ Name: 2,
9
+ Description: 3,
10
+ ObjectType: 4,
11
+ Identification: 5,
12
+ LongDescription: 6,
13
+ Status: 7,
14
+ WorkMethod: 8,
15
+ IsMilestone: 9,
16
+ Priority: 10,
17
+ TaskTime: 11,
18
+ PredefinedType: 12,
19
+ };
20
+ /**
21
+ * IFC2X3 IfcTask layout — the attributes IfcTask itself adds over IfcObject
22
+ * (TaskId, Status, WorkMethod, IsMilestone, Priority). IFC2X3 schedule times
23
+ * live on `IfcScheduleTimeControl` and link to IfcTask via `IfcRelAssignsTasks`
24
+ * — we don't resolve those here yet; best-effort 2x3 models only surface task
25
+ * metadata without dates.
26
+ */
27
+ export const TASK_ATTR_2X3 = {
28
+ GlobalId: 0,
29
+ Name: 2,
30
+ Description: 3,
31
+ ObjectType: 4,
32
+ TaskId: 5,
33
+ Status: 6,
34
+ WorkMethod: 7,
35
+ IsMilestone: 8,
36
+ Priority: 9,
37
+ };
38
+ const TASK_TIME_ATTR = {
39
+ Name: 0,
40
+ DurationType: 3,
41
+ ScheduleDuration: 4,
42
+ ScheduleStart: 5,
43
+ ScheduleFinish: 6,
44
+ EarlyStart: 7,
45
+ EarlyFinish: 8,
46
+ LateStart: 9,
47
+ LateFinish: 10,
48
+ FreeFloat: 11,
49
+ TotalFloat: 12,
50
+ IsCritical: 13,
51
+ StatusTime: 14,
52
+ ActualDuration: 15,
53
+ ActualStart: 16,
54
+ ActualFinish: 17,
55
+ RemainingTime: 18,
56
+ Completion: 19,
57
+ };
58
+ export const REL_SEQUENCE_ATTR = {
59
+ GlobalId: 0,
60
+ RelatingProcess: 4,
61
+ RelatedProcess: 5,
62
+ TimeLag: 6,
63
+ SequenceType: 7,
64
+ UserDefinedSequenceType: 8,
65
+ };
66
+ export const REL_ASSIGNS_TO_PROCESS_ATTR = {
67
+ RelatedObjects: 4,
68
+ RelatingProcess: 6,
69
+ };
70
+ export const REL_ASSIGNS_TO_CONTROL_ATTR = {
71
+ RelatedObjects: 4,
72
+ RelatingControl: 6,
73
+ };
74
+ export const REL_NESTS_ATTR = {
75
+ RelatingObject: 4,
76
+ RelatedObjects: 5,
77
+ };
78
+ export const WORK_SCHEDULE_ATTR = {
79
+ GlobalId: 0,
80
+ Name: 2,
81
+ Description: 3,
82
+ ObjectType: 4,
83
+ Identification: 5,
84
+ CreationDate: 6,
85
+ Purpose: 8,
86
+ Duration: 9,
87
+ TotalFloat: 10,
88
+ StartTime: 11,
89
+ FinishTime: 12,
90
+ PredefinedType: 13,
91
+ };
92
+ export const WORK_PLAN_ATTR = WORK_SCHEDULE_ATTR;
93
+ const LAG_TIME_ATTR = {
94
+ LagValue: 3,
95
+ DurationType: 4,
96
+ };
97
+ export function asString(v) {
98
+ if (typeof v === 'string' && v.length > 0)
99
+ return v;
100
+ return undefined;
101
+ }
102
+ export function asNumber(v) {
103
+ if (typeof v === 'number' && Number.isFinite(v))
104
+ return v;
105
+ return undefined;
106
+ }
107
+ export function asBoolean(v) {
108
+ if (typeof v === 'boolean')
109
+ return v;
110
+ // STEP booleans are typically stored as '.T.' / '.F.' after parsing
111
+ if (typeof v === 'string') {
112
+ if (v === '.T.' || v === 'T')
113
+ return true;
114
+ if (v === '.F.' || v === 'F')
115
+ return false;
116
+ }
117
+ return undefined;
118
+ }
119
+ export function asEnum(v) {
120
+ if (typeof v !== 'string' || v.length === 0)
121
+ return undefined;
122
+ // STEP enum looks like .PLANNED.
123
+ const match = v.match(/^\.([A-Z_]+)\.$/);
124
+ return match ? match[1] : undefined;
125
+ }
126
+ export function asRef(v) {
127
+ if (typeof v === 'number' && Number.isInteger(v) && v > 0)
128
+ return v;
129
+ return undefined;
130
+ }
131
+ export function asRefList(v) {
132
+ if (!Array.isArray(v))
133
+ return [];
134
+ const out = [];
135
+ for (const x of v) {
136
+ const id = asRef(x);
137
+ if (id !== undefined)
138
+ out.push(id);
139
+ }
140
+ return out;
141
+ }
142
+ export function sequenceTypeFromString(s) {
143
+ switch (s) {
144
+ case 'START_START':
145
+ case 'START_FINISH':
146
+ case 'FINISH_START':
147
+ case 'FINISH_FINISH':
148
+ case 'USERDEFINED':
149
+ case 'NOTDEFINED':
150
+ return s;
151
+ default:
152
+ return 'FINISH_START';
153
+ }
154
+ }
155
+ function durationTypeFromString(s) {
156
+ switch (s) {
157
+ case 'WORKTIME':
158
+ case 'ELAPSEDTIME':
159
+ case 'NOTDEFINED':
160
+ return s;
161
+ default:
162
+ return undefined;
163
+ }
164
+ }
165
+ export function extractTaskTime(extractor, store, taskTimeId) {
166
+ const ref = store.entityIndex.byId.get(taskTimeId);
167
+ if (!ref)
168
+ return undefined;
169
+ const entity = extractor.extractEntity(ref);
170
+ if (!entity)
171
+ return undefined;
172
+ const t = entity.type.toUpperCase();
173
+ if (t !== 'IFCTASKTIME' && t !== 'IFCTASKTIMERECURRING')
174
+ return undefined;
175
+ const a = entity.attributes || [];
176
+ return {
177
+ durationType: durationTypeFromString(asEnum(a[TASK_TIME_ATTR.DurationType])),
178
+ scheduleDuration: asString(a[TASK_TIME_ATTR.ScheduleDuration]),
179
+ scheduleStart: asString(a[TASK_TIME_ATTR.ScheduleStart]),
180
+ scheduleFinish: asString(a[TASK_TIME_ATTR.ScheduleFinish]),
181
+ earlyStart: asString(a[TASK_TIME_ATTR.EarlyStart]),
182
+ earlyFinish: asString(a[TASK_TIME_ATTR.EarlyFinish]),
183
+ lateStart: asString(a[TASK_TIME_ATTR.LateStart]),
184
+ lateFinish: asString(a[TASK_TIME_ATTR.LateFinish]),
185
+ freeFloat: asString(a[TASK_TIME_ATTR.FreeFloat]),
186
+ totalFloat: asString(a[TASK_TIME_ATTR.TotalFloat]),
187
+ isCritical: asBoolean(a[TASK_TIME_ATTR.IsCritical]),
188
+ statusTime: asString(a[TASK_TIME_ATTR.StatusTime]),
189
+ actualDuration: asString(a[TASK_TIME_ATTR.ActualDuration]),
190
+ actualStart: asString(a[TASK_TIME_ATTR.ActualStart]),
191
+ actualFinish: asString(a[TASK_TIME_ATTR.ActualFinish]),
192
+ remainingTime: asString(a[TASK_TIME_ATTR.RemainingTime]),
193
+ completion: asNumber(a[TASK_TIME_ATTR.Completion]),
194
+ };
195
+ }
196
+ export function extractLagTimeSeconds(extractor, store, lagId) {
197
+ const ref = store.entityIndex.byId.get(lagId);
198
+ if (!ref)
199
+ return {};
200
+ const entity = extractor.extractEntity(ref);
201
+ if (!entity)
202
+ return {};
203
+ if (entity.type.toUpperCase() !== 'IFCLAGTIME')
204
+ return {};
205
+ const a = entity.attributes || [];
206
+ const lagValue = a[LAG_TIME_ATTR.LagValue];
207
+ // lagValue is an IfcTimeOrRatioSelect — either a typed wrapper like
208
+ // ['IFCDURATION', 'P1D'] or a direct ratio number.
209
+ if (Array.isArray(lagValue) && lagValue.length === 2) {
210
+ const typeName = String(lagValue[0]).toUpperCase();
211
+ const inner = lagValue[1];
212
+ if (typeName === 'IFCDURATION' && typeof inner === 'string') {
213
+ return { seconds: parseIso8601Duration(inner), duration: inner };
214
+ }
215
+ }
216
+ else if (typeof lagValue === 'string') {
217
+ return { seconds: parseIso8601Duration(lagValue), duration: lagValue };
218
+ }
219
+ return {};
220
+ }
221
+ //# sourceMappingURL=schedule-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-types.js","sourceRoot":"","sources":["../src/schedule-types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAqB/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,EAAE;CACV,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC;IACd,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;CACH,CAAC;AAEX,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,CAAC;IACP,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,CAAC;IACnB,aAAa,EAAE,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C,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACnE,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Detects elements whose direct storey containment is ambiguous in the
3
+ * SOURCE FILE itself, i.e. more than one `IfcRelContainedInSpatialStructure`
4
+ * edge names a *different* storey-like spatial structure as the RelatingStructure
5
+ * for the same element (#4311).
6
+ *
7
+ * `elementToStorey` resolves each of these to a single winner, but this
8
+ * module deliberately treats HOW that winner is picked as an implementation
9
+ * detail it does not depend on or describe: as shipped on this branch
10
+ * (pre-#4310), spatial-hierarchy-builder.ts's direct-containment loop
11
+ * assigns `elementToStorey` unconditionally on every storey it visits, so
12
+ * the last storey reached in the aggregation-driven tree walk wins, NOT the
13
+ * first-declared `IfcRelContainedInSpatialStructure` edge - the tie-break is
14
+ * aggregation-order dependent, not declaration-order dependent. #4310
15
+ * changes that to first-declared-wins. Either way, this module answers the
16
+ * question that resolution silently discards - was there more than one
17
+ * candidate at all. The input is `byStorey`, the per-storey list of
18
+ * DIRECTLY contained elements that `SpatialHierarchyBuilder.assemble()`
19
+ * already produces regardless of tie-break strategy, so this stays correct
20
+ * across past and future changes to the resolution logic without needing to
21
+ * change with it.
22
+ *
23
+ * Two edges that repeat the SAME (storey, element) pair are not ambiguous -
24
+ * `RelationshipGraphBuilder` dedupes same-source/target/type `IfcRel*`
25
+ * instances into one edge before either side of this ever sees them
26
+ * (`relationship-graph.ts`), so a genuine duplicate declaration of the exact
27
+ * same fact never reaches `byStorey` twice for the same storey. Only a
28
+ * SECOND, DIFFERENT storey claiming the element counts.
29
+ */
30
+ /** elementId -> storeyId, DIRECT storey containment only (one entry per
31
+ * storey; see `SpatialHierarchy.byStorey`). */
32
+ export type ByStorey = ReadonlyMap<number, readonly number[]>;
33
+ /**
34
+ * Returns the set of element ids that appear under more than one distinct
35
+ * storey in `byStorey`. O(total direct storey-element pairs); no extra graph
36
+ * traversal beyond what `byStorey` already required to build.
37
+ */
38
+ export declare function computeAmbiguousStorey(byStorey: ByStorey): Set<number>;
39
+ //# sourceMappingURL=spatial-hierarchy-ambiguity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-hierarchy-ambiguity.d.ts","sourceRoot":"","sources":["../src/spatial-hierarchy-ambiguity.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;gDACgD;AAChD,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CActE"}
@@ -0,0 +1,25 @@
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
+ * Returns the set of element ids that appear under more than one distinct
6
+ * storey in `byStorey`. O(total direct storey-element pairs); no extra graph
7
+ * traversal beyond what `byStorey` already required to build.
8
+ */
9
+ export function computeAmbiguousStorey(byStorey) {
10
+ const firstStorey = new Map();
11
+ const ambiguous = new Set();
12
+ for (const [storeyId, elementIds] of byStorey) {
13
+ for (const elementId of elementIds) {
14
+ const seen = firstStorey.get(elementId);
15
+ if (seen === undefined) {
16
+ firstStorey.set(elementId, storeyId);
17
+ }
18
+ else if (seen !== storeyId) {
19
+ ambiguous.add(elementId);
20
+ }
21
+ }
22
+ }
23
+ return ambiguous;
24
+ }
25
+ //# sourceMappingURL=spatial-hierarchy-ambiguity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-hierarchy-ambiguity.js","sourceRoot":"","sources":["../src/spatial-hierarchy-ambiguity.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAoC/D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAkB;IACvD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,KAAK,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC9C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACxC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YACvC,CAAC;iBAAM,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { EntityRef } from './types.js';
2
+ import { EntityExtractor } from './entity-extractor.js';
3
+ import type { IfcSourceBytes } from './source-bytes.js';
4
+ /** Source bytes needed to read on-demand attributes off the raw records
5
+ * (storey elevation, LongName). Present on the fresh-parse / cache-with-source
6
+ * path, absent on the source-less `buildFromCache` fallback. */
7
+ export interface AttributeSource {
8
+ source: Uint8Array | IfcSourceBytes;
9
+ entityIndex: {
10
+ byId: {
11
+ get(expressId: number): EntityRef | undefined;
12
+ };
13
+ };
14
+ lengthUnitScale: number;
15
+ }
16
+ /**
17
+ * Read an entity's LongName by schema attribute *name*. IfcSite / IfcBuilding /
18
+ * IfcBuildingStorey / IfcSpace (and the IFC4.3 facility/infra containers)
19
+ * declare LongName at index 7, but IfcProject carries it at a different slot,
20
+ * so resolving by name (not a fixed index) stays correct across the IfcRoot
21
+ * family. The lookup spans every bundled schema, so IFC4.3 leaves outside the
22
+ * parser's IFC4 codegen pin resolve too. Returns the trimmed value, or
23
+ * undefined when the type declares no LongName, it is empty, or no source
24
+ * buffer is available (the buildFromCache path).
25
+ */
26
+ export declare function extractLongName(expressId: number, attrSource: AttributeSource | undefined, attrExtractor: EntityExtractor | undefined): string | undefined;
27
+ /**
28
+ * Extract elevation from an IfcBuildingStorey. Elevation is attribute index 9
29
+ * in both IFC2x3 and IFC4 (GlobalId, OwnerHistory, Name, Description,
30
+ * ObjectType, ObjectPlacement, Representation, LongName, CompositionType,
31
+ * Elevation).
32
+ */
33
+ export declare function extractElevation(expressId: number, source: Uint8Array | IfcSourceBytes, entityIndex: {
34
+ byId: {
35
+ get(expressId: number): EntityRef | undefined;
36
+ };
37
+ }): number | undefined;
38
+ /**
39
+ * Resolve a storey's elevation from its ObjectPlacement, used as a fallback when
40
+ * the Elevation attribute is null. Walks
41
+ * IfcBuildingStorey.ObjectPlacement (IfcLocalPlacement)
42
+ * -> RelativePlacement (IfcAxis2Placement3D)
43
+ * -> Location (IfcCartesianPoint).Coordinates[2]
44
+ * i.e. the storey's Z relative to its parent spatial container, which matches
45
+ * the semantics of the Elevation attribute and avoids folding in any site-level
46
+ * georeferencing Z. Returns the raw (unscaled) Z, or undefined when the chain
47
+ * can't be resolved.
48
+ */
49
+ export declare function extractPlacementElevation(expressId: number, source: Uint8Array | IfcSourceBytes, entityIndex: {
50
+ byId: {
51
+ get(expressId: number): EntityRef | undefined;
52
+ };
53
+ }): number | undefined;
54
+ //# sourceMappingURL=spatial-hierarchy-attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spatial-hierarchy-attributes.d.ts","sourceRoot":"","sources":["../src/spatial-hierarchy-attributes.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD;;iEAEiE;AACjE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,GAAG,cAAc,CAAC;IACpC,WAAW,EAAE;QAAE,IAAI,EAAE;YAAE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;SAAE,CAAA;KAAE,CAAC;IACzE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,aAAa,EAAE,eAAe,GAAG,SAAS,GACzC,MAAM,GAAG,SAAS,CAmBpB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,WAAW,EAAE;IAAE,IAAI,EAAE;QAAE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,GACvE,MAAM,GAAG,SAAS,CAqCpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,WAAW,EAAE;IAAE,IAAI,EAAE;QAAE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,GACvE,MAAM,GAAG,SAAS,CAoCpB"}