Skip to main content

ifc_spatial/tree/
anomaly.rs

1//! Conflicts the file states and the tree had to resolve.
2
3use ifc_model::EntityId;
4
5/// A statement of the file the tree could not honour, recorded instead of
6/// silently dropped.
7///
8/// A second parent the schema forbids: both
9/// `IfcElement.ContainedInStructure` and `IfcObjectDefinition.Decomposes`
10/// are `SET [0:1]`. A file naming two parents is malformed; the first
11/// relationship processed wins so the tree stays a tree, and the loser is
12/// reported here. Every view of the tree agrees with the kept answer.
13///
14/// A spatial relationship whose structure is not a spatial container of the
15/// release: its elements have nowhere to be listed, so the relationship is
16/// reported rather than ignored.
17#[derive(Debug, Clone, Copy, PartialEq, Eq)]
18#[non_exhaustive]
19pub enum SpatialAnomaly {
20    /// An element placed in two different spatial structures.
21    ContainedTwice {
22        /// The element with two homes.
23        element: EntityId,
24        /// The structure kept.
25        kept: EntityId,
26        /// The structure rejected; it does not list the element.
27        rejected: EntityId,
28        /// The `IfcRelContainedInSpatialStructure` that was rejected.
29        relation: EntityId,
30    },
31    /// A container aggregated by two different parents.
32    AggregatedTwice {
33        /// The container with two parents.
34        child: EntityId,
35        /// The parent kept.
36        kept: EntityId,
37        /// The parent rejected; it does not list the child.
38        rejected: EntityId,
39        /// The `IfcRelAggregates` that was rejected.
40        relation: EntityId,
41    },
42    /// An `IfcRelContainedInSpatialStructure` whose `RelatingStructure` is
43    /// not a spatial container of the release; its elements are not placed.
44    ContainedInNonContainer {
45        /// The relationship.
46        relation: EntityId,
47        /// The entity it names as the structure.
48        structure: EntityId,
49    },
50    /// An `IfcRelReferencedInSpatialStructure` whose `RelatingStructure` is
51    /// not a spatial container of the release; its elements are not listed.
52    ReferencedInNonContainer {
53        /// The relationship.
54        relation: EntityId,
55        /// The entity it names as the structure.
56        structure: EntityId,
57    },
58}