#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum SpatialKind {
Project,
Site,
Building,
Storey,
Space,
OtherContainer,
Element,
}
impl SpatialKind {
#[must_use]
pub fn classify(type_name: &str) -> Self {
let upper = type_name.to_ascii_uppercase();
match upper.as_str() {
"IFCPROJECT" => Self::Project,
"IFCSITE" => Self::Site,
"IFCBUILDING" => Self::Building,
"IFCBUILDINGSTOREY" => Self::Storey,
"IFCSPACE" => Self::Space,
_ if upper.starts_with("IFCSPATIAL") || upper == "IFCFACILITY" => Self::OtherContainer,
_ => Self::Element,
}
}
#[must_use]
pub const fn is_container(self) -> bool {
!matches!(self, Self::Element)
}
}