ifc_lite_server/services/data_model/generated/
relationship_slots.rs

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//! Relationship attribute slots per `IfcRelationship` subtype (issue #4205).
6//!
7//! DO NOT EDIT — generated by `scripts/generate-server-relationship-slots.mjs`
8//! from `@ifc-lite/parser`'s schema-derived `relationship-schema-slots.ts`
9//! (the same source the in-browser/WASM columnar parser resolves relationship
10//! slots against), so the server-parse path reads `RelatingX`/`RelatedY` at
11//! IDENTICAL attribute positions.
12//!
13//! Lookup key is the UPPERCASE STEP type name. Indices are ABSOLUTE attribute
14//! positions (i.e. `relationship-schema-slots.ts`'s 0-based-after-root index
15//! plus the shared 4-attribute IfcRoot+IfcRelationship prefix), matching what
16//! `DecodedEntity::get_ref`/`get_list` expect.
17//!
18//! `54` of `55` schema-derived concrete
19//! `IfcRelationship` subtypes resolved a slot plan. `IFCRELASSOCIATES` did not: it has
20//! no `RelatingX` attribute of its own in ANY bundled schema version (an
21//! abstract supertype that IFC2X3's bundled registry happens to mark
22//! non-abstract — see the generator script's header for the full
23//! explanation). It is intentionally absent from this table; no concrete
24//! STEP file instantiates it directly.
25
26/// One relationship type's relating/related attribute slots.
27///
28/// `relating_is_list` is true for exactly one type as of writing —
29/// `IFCRELDEFINESBYPROPERTIES`: `RelatingPropertyDefinition` is typed
30/// `IfcPropertySetDefinitionSelect`, whose second alternative
31/// (`IfcPropertySetDefinitionSet`) is a defined `SET` of entities, written
32/// inline as `(#20,#21)` rather than as a single `#id`. Reading it with
33/// `get_ref` alone returns `None` for that shape and silently drops the
34/// whole relationship — the same failure mode `related_is_list` already
35/// guards against on the other slot.
36#[derive(Debug, Clone, Copy)]
37pub struct RelationshipSlots {
38    pub relating_idx: u8,
39    pub related_idx: u8,
40    pub relating_is_list: bool,
41    pub related_is_list: bool,
42}
43
44/// Relating/related attribute slots for a STEP relationship keyword, or
45/// `None` if the type is not a schema-derived concrete `IfcRelationship`
46/// subtype (or is the single documented exception above).
47pub fn relationship_slots(upper_type_name: &str) -> Option<RelationshipSlots> {
48    match upper_type_name {
49        "IFCRELADHERESTOELEMENT" => Some(RelationshipSlots {
50            relating_idx: 4,
51            related_idx: 5,
52            relating_is_list: false,
53            related_is_list: true,
54        }),
55        "IFCRELAGGREGATES" => Some(RelationshipSlots {
56            relating_idx: 4,
57            related_idx: 5,
58            relating_is_list: false,
59            related_is_list: true,
60        }),
61        "IFCRELASSIGNSTASKS" => Some(RelationshipSlots {
62            relating_idx: 6,
63            related_idx: 4,
64            relating_is_list: false,
65            related_is_list: true,
66        }),
67        "IFCRELASSIGNSTOACTOR" => Some(RelationshipSlots {
68            relating_idx: 6,
69            related_idx: 4,
70            relating_is_list: false,
71            related_is_list: true,
72        }),
73        "IFCRELASSIGNSTOCONTROL" => Some(RelationshipSlots {
74            relating_idx: 6,
75            related_idx: 4,
76            relating_is_list: false,
77            related_is_list: true,
78        }),
79        "IFCRELASSIGNSTOGROUP" => Some(RelationshipSlots {
80            relating_idx: 6,
81            related_idx: 4,
82            relating_is_list: false,
83            related_is_list: true,
84        }),
85        "IFCRELASSIGNSTOGROUPBYFACTOR" => Some(RelationshipSlots {
86            relating_idx: 6,
87            related_idx: 4,
88            relating_is_list: false,
89            related_is_list: true,
90        }),
91        "IFCRELASSIGNSTOPROCESS" => Some(RelationshipSlots {
92            relating_idx: 6,
93            related_idx: 4,
94            relating_is_list: false,
95            related_is_list: true,
96        }),
97        "IFCRELASSIGNSTOPRODUCT" => Some(RelationshipSlots {
98            relating_idx: 6,
99            related_idx: 4,
100            relating_is_list: false,
101            related_is_list: true,
102        }),
103        "IFCRELASSIGNSTOPROJECTORDER" => Some(RelationshipSlots {
104            relating_idx: 6,
105            related_idx: 4,
106            relating_is_list: false,
107            related_is_list: true,
108        }),
109        "IFCRELASSIGNSTORESOURCE" => Some(RelationshipSlots {
110            relating_idx: 6,
111            related_idx: 4,
112            relating_is_list: false,
113            related_is_list: true,
114        }),
115        "IFCRELASSOCIATESAPPLIEDVALUE" => Some(RelationshipSlots {
116            relating_idx: 5,
117            related_idx: 4,
118            relating_is_list: false,
119            related_is_list: true,
120        }),
121        "IFCRELASSOCIATESAPPROVAL" => Some(RelationshipSlots {
122            relating_idx: 5,
123            related_idx: 4,
124            relating_is_list: false,
125            related_is_list: true,
126        }),
127        "IFCRELASSOCIATESCLASSIFICATION" => Some(RelationshipSlots {
128            relating_idx: 5,
129            related_idx: 4,
130            relating_is_list: false,
131            related_is_list: true,
132        }),
133        "IFCRELASSOCIATESCONSTRAINT" => Some(RelationshipSlots {
134            relating_idx: 6,
135            related_idx: 4,
136            relating_is_list: false,
137            related_is_list: true,
138        }),
139        "IFCRELASSOCIATESDOCUMENT" => Some(RelationshipSlots {
140            relating_idx: 5,
141            related_idx: 4,
142            relating_is_list: false,
143            related_is_list: true,
144        }),
145        "IFCRELASSOCIATESLIBRARY" => Some(RelationshipSlots {
146            relating_idx: 5,
147            related_idx: 4,
148            relating_is_list: false,
149            related_is_list: true,
150        }),
151        "IFCRELASSOCIATESMATERIAL" => Some(RelationshipSlots {
152            relating_idx: 5,
153            related_idx: 4,
154            relating_is_list: false,
155            related_is_list: true,
156        }),
157        "IFCRELASSOCIATESPROFILEDEF" => Some(RelationshipSlots {
158            relating_idx: 5,
159            related_idx: 4,
160            relating_is_list: false,
161            related_is_list: true,
162        }),
163        "IFCRELASSOCIATESPROFILEPROPERTIES" => Some(RelationshipSlots {
164            relating_idx: 5,
165            related_idx: 4,
166            relating_is_list: false,
167            related_is_list: true,
168        }),
169        "IFCRELCONNECTSELEMENTS" => Some(RelationshipSlots {
170            relating_idx: 5,
171            related_idx: 6,
172            relating_is_list: false,
173            related_is_list: false,
174        }),
175        "IFCRELCONNECTSPATHELEMENTS" => Some(RelationshipSlots {
176            relating_idx: 5,
177            related_idx: 6,
178            relating_is_list: false,
179            related_is_list: false,
180        }),
181        "IFCRELCONNECTSPORTS" => Some(RelationshipSlots {
182            relating_idx: 4,
183            related_idx: 5,
184            relating_is_list: false,
185            related_is_list: false,
186        }),
187        "IFCRELCONNECTSPORTTOELEMENT" => Some(RelationshipSlots {
188            relating_idx: 4,
189            related_idx: 5,
190            relating_is_list: false,
191            related_is_list: false,
192        }),
193        "IFCRELCONNECTSSTRUCTURALACTIVITY" => Some(RelationshipSlots {
194            relating_idx: 4,
195            related_idx: 5,
196            relating_is_list: false,
197            related_is_list: false,
198        }),
199        "IFCRELCONNECTSSTRUCTURALELEMENT" => Some(RelationshipSlots {
200            relating_idx: 4,
201            related_idx: 5,
202            relating_is_list: false,
203            related_is_list: false,
204        }),
205        "IFCRELCONNECTSSTRUCTURALMEMBER" => Some(RelationshipSlots {
206            relating_idx: 4,
207            related_idx: 5,
208            relating_is_list: false,
209            related_is_list: false,
210        }),
211        "IFCRELCONNECTSWITHECCENTRICITY" => Some(RelationshipSlots {
212            relating_idx: 4,
213            related_idx: 5,
214            relating_is_list: false,
215            related_is_list: false,
216        }),
217        "IFCRELCONNECTSWITHREALIZINGELEMENTS" => Some(RelationshipSlots {
218            relating_idx: 5,
219            related_idx: 6,
220            relating_is_list: false,
221            related_is_list: false,
222        }),
223        "IFCRELCONTAINEDINSPATIALSTRUCTURE" => Some(RelationshipSlots {
224            relating_idx: 5,
225            related_idx: 4,
226            relating_is_list: false,
227            related_is_list: true,
228        }),
229        "IFCRELCOVERSBLDGELEMENTS" => Some(RelationshipSlots {
230            relating_idx: 4,
231            related_idx: 5,
232            relating_is_list: false,
233            related_is_list: true,
234        }),
235        "IFCRELCOVERSSPACES" => Some(RelationshipSlots {
236            relating_idx: 4,
237            related_idx: 5,
238            relating_is_list: false,
239            related_is_list: true,
240        }),
241        "IFCRELDECLARES" => Some(RelationshipSlots {
242            relating_idx: 4,
243            related_idx: 5,
244            relating_is_list: false,
245            related_is_list: true,
246        }),
247        "IFCRELDEFINESBYOBJECT" => Some(RelationshipSlots {
248            relating_idx: 5,
249            related_idx: 4,
250            relating_is_list: false,
251            related_is_list: true,
252        }),
253        "IFCRELDEFINESBYPROPERTIES" => Some(RelationshipSlots {
254            relating_idx: 5,
255            related_idx: 4,
256            relating_is_list: true,
257            related_is_list: true,
258        }),
259        "IFCRELDEFINESBYTEMPLATE" => Some(RelationshipSlots {
260            relating_idx: 5,
261            related_idx: 4,
262            relating_is_list: false,
263            related_is_list: true,
264        }),
265        "IFCRELDEFINESBYTYPE" => Some(RelationshipSlots {
266            relating_idx: 5,
267            related_idx: 4,
268            relating_is_list: false,
269            related_is_list: true,
270        }),
271        "IFCRELFILLSELEMENT" => Some(RelationshipSlots {
272            relating_idx: 4,
273            related_idx: 5,
274            relating_is_list: false,
275            related_is_list: false,
276        }),
277        "IFCRELFLOWCONTROLELEMENTS" => Some(RelationshipSlots {
278            relating_idx: 5,
279            related_idx: 4,
280            relating_is_list: false,
281            related_is_list: true,
282        }),
283        "IFCRELINTERACTIONREQUIREMENTS" => Some(RelationshipSlots {
284            relating_idx: 8,
285            related_idx: 7,
286            relating_is_list: false,
287            related_is_list: false,
288        }),
289        "IFCRELINTERFERESELEMENTS" => Some(RelationshipSlots {
290            relating_idx: 4,
291            related_idx: 5,
292            relating_is_list: false,
293            related_is_list: false,
294        }),
295        "IFCRELNESTS" => Some(RelationshipSlots {
296            relating_idx: 4,
297            related_idx: 5,
298            relating_is_list: false,
299            related_is_list: true,
300        }),
301        "IFCRELOCCUPIESSPACES" => Some(RelationshipSlots {
302            relating_idx: 6,
303            related_idx: 4,
304            relating_is_list: false,
305            related_is_list: true,
306        }),
307        "IFCRELOVERRIDESPROPERTIES" => Some(RelationshipSlots {
308            relating_idx: 5,
309            related_idx: 4,
310            relating_is_list: false,
311            related_is_list: true,
312        }),
313        "IFCRELPOSITIONS" => Some(RelationshipSlots {
314            relating_idx: 4,
315            related_idx: 5,
316            relating_is_list: false,
317            related_is_list: true,
318        }),
319        "IFCRELPROJECTSELEMENT" => Some(RelationshipSlots {
320            relating_idx: 4,
321            related_idx: 5,
322            relating_is_list: false,
323            related_is_list: false,
324        }),
325        "IFCRELREFERENCEDINSPATIALSTRUCTURE" => Some(RelationshipSlots {
326            relating_idx: 5,
327            related_idx: 4,
328            relating_is_list: false,
329            related_is_list: true,
330        }),
331        "IFCRELSCHEDULESCOSTITEMS" => Some(RelationshipSlots {
332            relating_idx: 6,
333            related_idx: 4,
334            relating_is_list: false,
335            related_is_list: true,
336        }),
337        "IFCRELSEQUENCE" => Some(RelationshipSlots {
338            relating_idx: 4,
339            related_idx: 5,
340            relating_is_list: false,
341            related_is_list: false,
342        }),
343        "IFCRELSERVICESBUILDINGS" => Some(RelationshipSlots {
344            relating_idx: 4,
345            related_idx: 5,
346            relating_is_list: false,
347            related_is_list: true,
348        }),
349        "IFCRELSPACEBOUNDARY" => Some(RelationshipSlots {
350            relating_idx: 4,
351            related_idx: 5,
352            relating_is_list: false,
353            related_is_list: false,
354        }),
355        "IFCRELSPACEBOUNDARY1STLEVEL" => Some(RelationshipSlots {
356            relating_idx: 4,
357            related_idx: 5,
358            relating_is_list: false,
359            related_is_list: false,
360        }),
361        "IFCRELSPACEBOUNDARY2NDLEVEL" => Some(RelationshipSlots {
362            relating_idx: 4,
363            related_idx: 5,
364            relating_is_list: false,
365            related_is_list: false,
366        }),
367        "IFCRELVOIDSELEMENT" => Some(RelationshipSlots {
368            relating_idx: 4,
369            related_idx: 5,
370            relating_is_list: false,
371            related_is_list: false,
372        }),
373        _ => None,
374    }
375}