ifc_style/surface_style/
shading.rs1use ifc_model::EntityId;
4
5use crate::error::StyleResult;
6use crate::view::Record;
7
8#[derive(Debug, Clone, Copy)]
12pub struct SurfaceStyleShading<'m, 's> {
13 record: Record<'m, 's>,
14}
15
16impl<'m, 's> SurfaceStyleShading<'m, 's> {
17 pub(crate) fn from_record(record: Record<'m, 's>) -> Self {
18 Self { record }
19 }
20
21 pub fn surface_colour(&self) -> StyleResult<EntityId> {
23 self.record.required_ref("SurfaceColour", "IfcColourRgb")
24 }
25
26 pub fn transparency(&self) -> StyleResult<Option<f64>> {
28 self.record.optional_normalized("Transparency")
29 }
30}