Add Surfaces

This commit is contained in:
Hanno Braun 2022-10-11 13:02:45 +02:00
parent e02c595247
commit c1972f618c

View File

@ -83,8 +83,6 @@ mod solid;
mod surface; mod surface;
mod vertex; mod vertex;
use crate::storage::Store;
pub use self::{ pub use self::{
curve::{Curve, GlobalCurve}, curve::{Curve, GlobalCurve},
cycle::Cycle, cycle::Cycle,
@ -97,6 +95,8 @@ pub use self::{
vertex::{GlobalVertex, SurfaceVertex, Vertex}, vertex::{GlobalVertex, SurfaceVertex, Vertex},
}; };
use crate::storage::{Handle, Store};
/// The available object stores /// The available object stores
/// ///
/// # Implementation Note /// # Implementation Note
@ -117,7 +117,7 @@ pub struct Objects {
pub global_vertices: Store<GlobalVertex>, pub global_vertices: Store<GlobalVertex>,
/// Store for surfaces /// Store for surfaces
pub surfaces: Store<Surface>, pub surfaces: Surfaces,
} }
impl Objects { impl Objects {
@ -126,3 +126,16 @@ impl Objects {
Self::default() Self::default()
} }
} }
/// The store for [`Surface`]s
#[derive(Debug, Default)]
pub struct Surfaces {
store: Store<Surface>,
}
impl Surfaces {
/// Insert a surface into the store
pub fn insert(&self, surface: Surface) -> Handle<Surface> {
self.store.insert(surface)
}
}