1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Optical surface structure.

use crate::{access, geom::Mesh};

/// Optical surface.
pub struct Surface<'a, T> {
    /// Mesh.
    mesh: Mesh,
    /// Attribute.
    attr: &'a T,
}

impl<'a, T> Surface<'a, T> {
    access!(mesh, Mesh);
    access!(attr, T);

    /// Construct a new instance.
    #[inline]
    #[must_use]
    pub const fn new(mesh: Mesh, attr: &'a T) -> Self {
        Self { mesh, attr }
    }
}