ifc_template_catalog/definition/quantity.rs
1//! Quantity-template definitions.
2
3use super::LocalizedText;
4
5/// External physical quantity template.
6#[derive(Debug, Clone, PartialEq, Eq, bincode::Encode, bincode::Decode)]
7pub struct QuantityTemplate {
8 /// `Name` as declared by the publication.
9 pub name: String,
10 /// `Definition` prose, absent when the publication omitted it.
11 pub definition: Option<String>,
12 /// Localized alternates for `name` in other publication languages.
13 pub name_aliases: Vec<LocalizedText>,
14 /// Localized alternates for `definition` in other publication languages.
15 pub definition_aliases: Vec<LocalizedText>,
16 /// Which `IfcPhysicalQuantity` subtype this template describes.
17 pub kind: QuantityKind,
18}
19
20/// QTO quantity value family, corresponding to an `IfcPhysicalSimpleQuantity` subtype.
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, bincode::Encode, bincode::Decode)]
22#[non_exhaustive]
23pub enum QuantityKind {
24 /// `IfcQuantityLength`.
25 Length,
26 /// `IfcQuantityArea`.
27 Area,
28 /// `IfcQuantityVolume`.
29 Volume,
30 /// `IfcQuantityWeight`.
31 Weight,
32 /// `IfcQuantityTime`.
33 Time,
34 /// `IfcQuantityCount`.
35 Count,
36 /// `IfcQuantityNumber`.
37 Number,
38}